USC-MSA web (English) : Book 14, Hadith 1
Narration text is preserved in its supplied Arabic and English. Translated interfaces and reading guides do not add narration translations in other languages.
إِذَا ذَهَبَ أَحَدُكُمُ الْغَائِطَ أَوِ الْبَوْلَ فَلاَ يَسْتَقْبِلِ الْقِبْلَةَ وَلاَ يَسْتَدْبِرْهَا بِفَرْجِهِ "
Yahya related to me from Malik from Ishaq ibn Abdullah ibn Abi Talha that Rafiibn Ishaq, a mawla of the family of ash-Shifa who was known as the mawla of Abu Talha, heard Abu Ayyub al-Ansari, one of the companions of the Messenger of Allah (ﷺ) say, while he was in Egypt, "By Allah! I don't know how to deal with these lavatories." The Messenger of Allah (ﷺ) said, "When you go to defecate or urinate, do not expose your genitals towards the qibla, and do not put your back to it."
Full reference and source
USC-MSA web (English) : Book 14, Hadith 1 Arabic : Book 14, Hadith 458
View source on Sunnah.com (opens in a new tab)