Go into Options and then Controls—you'll see that pressing F4 makes a soldier follow you, with "follow me" appearing in the top-left corner. Note that you can't do this as a hero. In the career section, your rank determines how many men you can lead:
Private – one man
Sergeant – two men
Captain – three men
General – four men
To stop someone from following you, point at them and press F4 again; "move out" will appear in the corner.