Patrol between 2 (or more) points
When you have units in your selection you can press "P" for the Patrol Command. Click with your Left Mouse and your units with patrol between their current and the clicked position.
Patrolling units are in "Fight-mode" and will assault any enemy units in the area or their patrol.
Patrol is also very useful for construction- and resurrect-units. They will repair and reclaim metal and energy along the patrol-route, and only reclaim when resources are low.
TIP: You can set multiple patrolling waypoints while holding down SHIFT when placing the Patrol-commands.
Usually you first will use a Move command to the startposition of the patrol-route. Then, while holding down SHIFT, press "P" and the click all waypoints. Units will repeat this patrol route.