If it is night and the light was turned on by a Rule you know not to change the occupancy switch for that room.
Just send an OFF command to the Group that contains all the Items that indicate occupancy.
You will probably want to draw out a state diagram to make sure you don’t have any incompatible state transitions. You can easily end up in a situation where a state transition event changes and you end up in two incompatible states.
For a setup this complex you will probably want to use a bunch of proxy items so you have some control over how the events propigate.