In the absence of detected forces a group with a Guard waypoint will first move to the position of the waypoint. It will then move to the centre of the guarded by trigger area and stay there. If there are multiple trigger areas it will just go to one. Only one guard group will move to each trigger area, so if you have one trigger and two groups only one will move to the trigger. If you have two triggers and two groups then one will move to each.
If the enemy is detected in two places at once - one in a guarded by trigger area and one not - then if there is only one guard group it will be directed towards the one in the trigger area, other things being equal.
At least that's my understanding, I may be wrong.
If you want to know more about how they work I suggest you set up some experiments.
Do all the units on a guard waypoint move to the guarded by trigger or just one unit
Only groups can have a waypoints. And waypoints control groups, not units. In other words a waypoint can only give an instruction to a group - it can't control units.