He forgot to turn off the fan while/before leaving. He probably couldn't have turned it off after leaving.
New words, one handy idiom, and a 2-minute quiz — delivered to your inbox to keep your streak alive.
Vincent TeoCan I say,Be sure to double-check your posts, as I'm sure the second sentence is just a typo (and some of us are masters at typos). Otherwise your sentences are correct.
He forgets to switch off the television when he is leaving the room.
He forget to switch off the fan when going to bed.