Abdullah bin Umar reported,

Abdullah bin Umar said that some people claim, "When you sit to relieve yourself, do not face the qiblah or Bayt al-Maqdis."Then Abdullah bin Umar said, "One day I climbed up onto the roof of one of our houses, and I saw the Messenger of Allah ﷺ on two bricks, facing Bayt al-Maqdis while relieving himself."He also said, "Perhaps you are among those who pray on their haunches?"I said, "By Allah, I do not know."Malik explained that this refers to one who prays without raising himself from the ground, prostrating while pressed flat against it.

Bukhari 145

Sahih

حدثنا عبد الله بن يوسف قال أخبرنا مالك عن يحيى بن سعيد عن محمد بن يحيى بن حبان عن عمه واسع بن حبان

عن عبد الله بن عمر

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

البخاري 145صحيح
Contents
Reference
Commentary
Ayat
Collection
Sahih Bukhari
Book
Wudu
Chapter
Relieving oneself over two bricks
Numbering
Darussalam 145
Bukhari 145