I think there a lot of ways to do this and it depends on how things are set up for you, but here's what I did regarding that (using a virtual contact sensor so I could trigger Routines on Alexa with the resulting status): Help understanding how to notify after delay
Easy to achieve via the Combined Presence App. It let’s you define the conditions for exactly these cases and more. I created an ‘Anyone Home’ virtual presence device with these specific rules and it works flawlessly.
You can then trigger any rules you’d like against the Anyone Home presence device for executing on ‘present’ and ‘not present’ status..
As @9369292f1992a7d0e654 has said easy to do with the combined presence app. I get extremely accurate results by using the iPhone Presence and the Combined Presense drivers paired with the Hubitat mobile app's built in GeoFencing. I carry 2 phones, one personal and one work phone so I have a combiner for the combination of the two.
Tike the others above, I used combined presence, but only to combine presence from multiple sources to mark a user present or not.
To activate or dis activate the alarm, I use a “change” trigger on all family members presence. I use an of condition to determine if the alarm should arm or disarm... if all absent, arm; else, disarm.