It is narrated from Sayyiduna Abu Ayyub (may Allah be pleased with him), with whom the Messenger of Allah (peace and blessings be upon him) stayed, that the Messenger of Allah (peace and blessings be upon him) said: "When one of you urinates or relieves himself, let him not face the qiblah with his private part, nor turn his back to it."
Hadith Referenceالمعجم الكبير للطبراني / باب الخاء / 3919