See screenshots below. You can add each door’s both open and close event as trigger, so this rule will be kicked off when any of the door status changes. In the example below, I had two doors but you can add as many as you want.
Then in the flow, add first IF_Condition - when all doors’ status are ‘closed’, then set the switch to Off; otherwise, add the second IF_Condition - when any door’s status is open, then set the switch to On.
Since IF_Conditions can be nested and can be quite flexible in the case like this. Let me know if this helps.