If my 12 year old nephew sleeps in my bungalow together with me and my 13 year old son is it Yichud?
The basic halacha is that a woman and two men is not yichud during the day, however at night when they may be sleeping there is a need for a third man to be present. The reason for this is because when one of them is sleeping the other man is secluded with this woman, therefore there is a need for the extra man. (Although both of them are sleeping, since it is two people sleeping there, there is still a fear that one of them will wake up),
The poskim say that there are certain relatives that are a shomer even at night when they are sleeping, and there is no need for an extra person when they are present even when they are sleeping. One example of this is a spouse. A woman may sleep in the home of a couple even though the wife is sleeping, and it isn’t yichud, because a spouse is a shomer even when sleeping, The same applies to a woman with her mother in law or sister in law, one is a shomer on the other even when she is sleeping. According to a number of poskim, a son is a shomer for his mother even when he is sleeping, therefore since your son is a shomer for you, it is not yichud with your nephew even though your son is sleeping.
Best wishes .
Chochom Echad in Pischei Teshuva E:H 22-2, Dvar Halacha 8-7, Toras Hayichud 8-18,21, ftnt. 22 in the name of R’ Eliyashiv zt”l, Minchas Ish 11-18. However see also Pesach Habayis 9-7, and Orchos Habayis 14-30.