Is it permissible for a man to be at a woman's home at night if both of her parents are at home, but sleeping? What if they are awake?
[This is an old but highly-upvoted question and the two existing answers on the page are misleading as can be seen in the sources for this answer. So I thought it would be worth answering.]
The laws of yichud are complex, so it is worth CYLOR in specific cases. Nevertheless the answer to the question is yes in both cases (I now checked the reasoning with a rav and talmid hakham)
Yichud is allowed in a room which is open (see SA EH 22:9) (according to some poskim, also if closed but unlocked and people can come in at any time, or if there is a clear view into the room)
R Doniel Neustadt quotes R Moshe Feinstein as allowing a man to be secluded with a woman in the presence of the man's grandmother, mother, daughter, granddaughter or sister. During nighttime sleeping hours, an additional chaperon is required. A man and a woman may remain alone in a home where the parents of one of them are sleeping.
According to R Nissan Dovid Dubov "the presence of a single shomer is effective during the day. However at night, a single shomer is not adequate since the shomer may fall asleep. Therefore, the presence of two shomrim is required at night. Two shomrim are adequate even if both are sleeping, for the man and woman would fear that one shomer might awaken and discover any improper conduct."
They would have to be in the same room as either the man or woman. In the same house is not enough, since a closed door is effectively a different place. Since you can not see into it from outside. While sleeping only works if the person is easily roused - a deep sleeper is not an effective shomer. And in a different room is certainly not enough while sleeping, even if it may be OK if the person is awake and you expect they might enter unannounced.
A shomer is not a "game" - the person must actually guard, so anything that prevents that (loud noise, closed door, deep sleeper, etc) negates what they do.
This is on top of all the restrictions in what Menachem linked to.