Hello there @Lazur327 
Repeatable Home Base Defense Missions (the mission where waves of machines attack the home base) can be unlocked by winning battles in the region, similar to how rivals are created. Your region score influences your chance to unlock missions. After unlocking, the same mission can not be unlocked again for an hour.
Home Base Defense missions can be restarted and replayed as many times as you wish, after you have completed or failed them. To unlock them subsequent times after completing them once, you need to increase the corresponding Region’s insurrection level, just like when you are trying to provoke a machine into evolving into a Rival: by destroying enough machines in that Region.
EDIT: The second paragraph/explanation (above) is also available in-game as a tutorial that is triggered after completing the horde mission for the first time. The text can also be read in the tutorial section of the log menu at anytime.
I hope this makes it clearer how the Home Base Defense Mission works, and IF not, please let me know and I’ll try to explain it better!
Sorry for the confusion and thanks for reporting! 