About if statement

I would include 2 booleans in the lights. An “On” and a “TurnedOnFirst” variable. When a light is turned on, check to see if the other light is turned on, if the other light is off also turn on the “TurnedOnFirst” variable. Then just check to see if LightA “On” and “TurnedOnFirst” are true. Just make sure to turn both variables off when you turn off the light.