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. The purple movement lines indicate they will "Fight".
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.