Inaccessible area after player leaves

I feel like this is easy, but I wanna know how to set up a trigger volume and piston to where if a player leaves a certain aria, if no one else is in said area then the door opens, allowing others to go inside. If you’ve played ^FalloutFrontier, you’ll probably know what I mean. (If you leave a response instructing how to do this, please say it step by step.)