Sayyiduna Abu Ayyub al-Ansari (may Allah be pleased with him) said: The Messenger of Allah (peace and blessings be upon him) forbade us from facing the qiblah or turning our backs to it when one of us goes to urinate or relieve himself.
Hadith Referenceالمعجم الكبير للطبراني / باب الخاء / 3918