How do i make it so that when a player has no more buildings left, he loses?
None.
Trigger("WhoEver")
Conditions:
Command("Current Player", "Buildings", At most, 0);
Actions:
Defeat();
None.
The trigger you are looking for is one of the 3 default triggers in loading up a new map.
If you just think about the trigger logically, you should be able to figure out it would work.
None.