New Wincondition help

It’s my first mod, I’m trying to create a game mode in which you have to defend the boar and kill the enemy boar, but I don’t know how to make the wincondition for it to work