Door unlocks after a specific person leaves!? can't fix

Automation presence is a bit quirky and different from how SmartApps process it like @orangebucket pointed out. I’ve seen this automation work as you’ve written it and also fail at times. The automation appears to reevaluate the rules when anything changes rather than when it changes to the desired state.

If you have access to RBoyApps you can check out Lock User Management (LUM) which an option of creating a presence based user and one of the key features in there is the ability to lock and unlock doors when someone arrives or everyone leaves. This is more reliable since it checks specific states. You’ll see in the screenshot below you can set it to activate when any of these people are there (you and your husband) and when both leave it can lock the door and if anyone arrives it’ll unlock the door. So now if either of you get home it’ll also unlock the door for you. You can also set additional conditions like if specific people aren’t at home but that may not be applicable for your current use case. Also if you can have it assigned to specific locks and if you create two different presence users you can one lock all locks when everyone leaves and the other only unlock the front door when someone arrives.