Hazrat Abdur Rahman bin Abi Saeed narrates from his father, Sayyiduna Abu Saeed (may Allah be pleased with him), that the Messenger of Allah (peace and blessings be upon him) said: "No man should look at the private parts of another man, and no woman should look at the private parts of another woman. No man should sleep with another man in a single garment, nor should any woman sleep with another woman in a single garment."
Related hadith on this topic