Stamina will be used every time you attack an enemy formicary or anthill or any creatures on the maps, your ability to attack is based on your unit stamina and when you run out of stamina just log out in the game and wait for a few minutes and all your stamina will be restored. but don't forget to use a shield before you log out of the game.