Al-Ilmam bi-Ahadith al-Ahkam 173
وَعَن عبد الرَّحْمَن بن أبي سعيد الْخُدْرِيّ، عَن أَبِيه رَضِيَ اللَّهُ عَنْهما أَن رَسُول الله ﷺ قَالَ: " لَا ينظر الرجل إِلَى عَورَة الرجل، (وَلَا تنظر) الْمَرْأَة إِلَى عَورَة الْمَرْأَة، وَلَا يُفضي الرجل إِلَى الرجل فِي ثوب وَاحِد، (وَلَا تُفْضِي) الْمَرْأَة إِلَى الْمَرْأَة فِي الثَّوْب الْوَاحِد ". لفظ مُسلم.
From ʿAbd ar-Rahman ibn Abi Saʿid al-Khudri, from his father, may Allah be pleased with them both, that the Messenger of Allah ﷺ said: "A man should not look at the ʿawrah of a man, (nor should) a woman look at the ʿawrah of a woman; a man should not lie with a man under one garment, (nor should) a woman lie with a woman under one garment." Muslim's wording.