See this post: Pending Retirement of Rule 3.0
For your rule, try this:
Trigger Event: 5 presence sensors ANY depart
Actions:
IF (5 presence sensors ALL not present) HSM: Arm Away
That will check each time someone departs to see if all have left or not. That is a Simple Conditional action. If you needed to do more steps than just arming HSM, you would use IF (conditions) THEN instead, and list the actions after the IF-THEN.
BTW, HSM will do this for you. You can have it automatically Arm Away when the mode becomes Away. And Mode Manager can do that automatically when all of the presence sensors leave.