´It was narrated that Jabir said:` "The Messenger of Allah forbade facing the Qiblah when urinating. But I saw him, one year before he died, facing the Qiblah (while urinating)."
Hadith Referenceسنن ابن ماجه / كتاب الطهارة وسننها / 325
1؎: Jabir radi Allahu anhu understood that this prohibition was general for both the open desert and «بنیان» (inhabited area), and for this reason he considered it abrogated (mansukh), that the last action of the Messenger of Allah sallallahu alayhi wa sallam abrogated the prohibition. If the prohibition is considered specific to the open desert and field, then there will be neither any contradiction between the two actions, nor will there be any need to consider one as abrogating the other.
Explanation & Benefits
Maulana Ataullah Sajid
From the statement of Jabir radi Allahu anhu, it apparently seems that he considers this prohibition to be abrogated. However, if the prohibition is specified for open places, or if avoidance is considered superior and turning (one’s face) is deemed permissible, then there will be no need to consider it abrogated. And Allah knows best.
Source: Commentary on Sunan Ibn Mājah by Mawlānā ‘Atā’ullāh Sājid, Page: 325
Narrated Jabir ibn Abdullah: The Prophet of Allah ﷺ forbade us to face the qiblah at the time of making water. Then I saw him facing it (qiblah) urinating or easing himself one year before his death.
Shaykh Umar Farooq Saeedi
Benefits and Issues It is argued from these hadiths that it is permissible to turn one's back towards the Ka'bah in constructed toilets within houses. However, considering all the hadiths related to this issue, the preferred opinion appears to be that one should avoid this, as has been mentioned in the benefits and issues of Sunan Abu Dawood, hadith number [11]. For details, see: [الروضة الندية شرح الدررالبهية، باب ترك الاستقبال واستدبار القبلة]
Source: Sunan Abu Dawood – Commentary by Shaykh Umar Farooq Saeedi, Page: 13