What you are trying to accomplish requires basic AND / OR logic gates. In NR you can install “node-red-contrib-bool-gate” from the pallete manager to use this option.
Example below is for an AND gate… just change the inputs to reflect your door sensor(s)
[{"id":"f2e45728.5ec9a8","type":"and-gate","z":"25063fae.4f85f","name":"Example AND node ","rules":[{"t":"eq","v":"off","vt":"str","propertyType":"msg","property":"data","topic":"input_boolean.guest_mode"}],"outputTopic":"binary_sensor.ring_front_door_motion","gateType":"and","emitOnlyIfTrue":true,"x":1955.7142715454102,"y":1279.9999418258667,"wires":[["311f47d.dd460b8"]]},{"id":"bf8e01bd.ed04a","type":"debug","z":"25063fae.4f85f","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":1890.0000190734863,"y":1221.428620815277,"wires":[]},{"id":"a316f1aa.84c45","type":"server-state-changed","z":"25063fae.4f85f","name":"Ring Front Door Motion","server":"8a3231e1.3f0e1","version":1,"entityidfilter":"binary_sensor.front_door_motion","entityidfiltertype":"exact","outputinitially":false,"state_type":"str","haltifstate":"$entity().state = \"on\" and (\t $entities(\"sensor.iphoneexpress_zone\").state = \"home\" or $entities(\"sensor.garbineiphone_zone\").state = \"home\"\t)","halt_if_type":"jsonata","halt_if_compare":"jsonata","outputs":2,"output_only_on_state_change":true,"x":1695.7144317626953,"y":1287.1427993774414,"wires":[["bf8e01bd.ed04a","f2e45728.5ec9a8"],[]]},{"id":"7c4a5061.dab3a","type":"server-state-changed","z":"25063fae.4f85f","name":"Check if in Guest mode","server":"8a3231e1.3f0e1","version":1,"entityidfilter":"input_boolean.guest_mode","entityidfiltertype":"exact","outputinitially":true,"state_type":"str","haltifstate":"","halt_if_type":"str","halt_if_compare":"is","outputs":1,"output_only_on_state_change":true,"x":1555.357177734375,"y":1364.4644889831543,"wires":[["b3209a9.d25d968"]]},{"id":"b3209a9.d25d968","type":"change","z":"25063fae.4f85f","name":"msg.data","rules":[{"t":"move","p":"payload","pt":"msg","to":"data","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":1766.607192993164,"y":1364.8216452598572,"wires":[["f2e45728.5ec9a8"]]},{"id":"311f47d.dd460b8","type":"debug","z":"25063fae.4f85f","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":2151.428779602051,"y":1281.4286003112793,"wires":[]},{"id":"8a3231e1.3f0e1","type":"server","name":"Hassio","legacy":false,"rejectUnauthorizedCerts":true,"ha_boolean":"y|yes|true|on|home|open","connectionDelay":false}] ```