Load the trigger I've attached into your map (while looking at your triggers, you'll notice a button on the right that says 'Load Triggers'. Use that.)
You'll notice that it has a lot of conditions and actions, all with the player being "_". That "_" is Player 12, who owns all the units of players who leave the game. Simply delete the ones you don't need.
For example, load it into your map, and change it to:
Players:
All Players
Conditions:
"_" commands at least 1 men.
Actions:
Give all men owned by "_" at Anywhere to Player 1.
Preserve trigger.
That would make it so whenever a player leaves the game, all their units go to Player 1. Another action you might want to use is Kill all men for "_", as to not make Player 1 rigged by getting all the units.
If you have any questions about it, just ask.