Correct option is A
Option (a) "are leaving the room" contains a grammatical error.
Explanation: The correct phrase should be "before you leave the room" instead of "before you are leaving the room." The simple present tense "leave" is used in clauses with "before" to indicate an action that will happen in the future.
Correct Sentence: Please switch off all the lights before you leave the room.
Grammatical Rule Used: In time clauses introduced by words like "before" or "after," the simple present tense is used to refer to a future action.
Example: She will call you before she arrives.