Abdullah bin Umar reported,

Someone said, "People say that when you sit to relieve yourself, you should not face the qiblah or Bayt al-Maqdis."Abdullah bin Umar replied, "One day I climbed onto the roof of one of our houses and saw the Messenger of Allah ﷺ sitting on two bricks, facing Bayt al-Maqdis as he relieved himself."He then asked, "Perhaps you are one of those who pray on their backsides?"I answered, "By Allah, I do not know!"Malik explained, "He means one who prays without lifting himself from the ground, prostrating while pressed flat against it."

Azami 1410

Sahih

عن عبد الله بن عمر أنه كان يقول

إن ناسا يقولون: إذا قعدت على حاجتك فلا تستقبل القبلة ولا بيت المقدس، فقال عبد الله بن عمر: لقد ارتقيت يوما على ظهر بيت لنا، فرأيت رسول الله ﷺ على لبنتين مستقبلا بيت المقدس لحاجته، وقال: لعلك من الذين يصلون على أوراكهم؟ فقلت: لا أدري والله! قال مالك: يعني يصلي ولا يرتفع عن الأرض؛ يسجد وهو لاصق بالأرض.

الأعظمي 1410صحيح
Contents
Reference
Commentary
Ayat
Collection
Jami al-Kamil
Book
Purification
Section
Permissibility of facing or turning one's back to the qibla when relieving oneself in a building
Numbering
Jami al-Kamil 1410 (2nd edition)
Azami 1410