Do you want to learn how to do it in a game, or learn how to do it when making a map?
If you want to learn how to stack during a game heres how: I just copy and pasted this from my Disease Defense Final map.
Select a Probe, Dronev, or SCV
Hold the control button and press a number(remember it)
Move your Zergling to the Dark area to turn the lights off
Press the number you have pressed to set the team
Use your worker and build anywhere on land and stack
When you are finished, move your zergling to the white area to turn the lights on