First, all the devices you do not want to control de-select them from the "Devices to automate"
For the motion sensors, turn off "motion" as an option in means to activate, that should get rid of them if you dont want that as part of it (not sure why not??)
To prevent it from turning off under certain condition you use the Limit Turning Off section. I have a good example here where I prevent the motion inactive from turning off the bathroom lights if the bath fan is on: [Example] RL Bath Motion with Exhaust Fan and Preset Off
Basically, you could have your motion sensor and the contact sensor as means to turn off. Then at the same time you could have a limit that it wont turn off if there is motion or the contact sensor is still open. Doing that would require both the sensor be closed AND no motion, then the lights would go out.
Getting complicated like this, for some people it might make more sense in RM where you could do a wait for conditions and have it wait for both sensors to be in the correct state before it turns off.