I am not sure what exactly the meaning of this is.
I think the meaning should be "Turn the light out when you are coming (going)". To me nothing else makes sense but this one. So, it’s not an idiom.It’s just a bit confusing phrase :)
I think it implies that the last person out of a room should close it up/ turn out the lights / lock up.
it’s a way of saying, ‘please go away’