أَخْبَرَنَا مُحَمَّدُ بْنُ مَنْصُورٍ، قَالَ حَدَّثَنَا سُفْيَانُ، عَنِ الزُّهْرِيِّ، عَنْ عَطَاءِ بْنِ يَزِيدَ، عَنْ أَبِي أَيُّوبَ، أَنَّ النَّبِيَّ صلى الله عليه وسلم قَالَ ‏"‏ لاَ تَسْتَقْبِلُوا الْقِبْلَةَ وَلاَ تَسْتَدْبِرُوهَا لِغَائِطٍ أَوْ بَوْلٍ وَلَكِنْ شَرِّقُوا أَوْ غَرِّبُوا ‏"‏ ‏.‏

It was narrated from Abu Ayyub that the Prophet (PBUH) said: "Do not face towards the Qiblah nor turn your backs toward it when defecating or urinating, rather face toward the east or the west." Translation Not Available

Book Ref: Sunan An Nisai Book 1 Hadith 21
Web Ref:  Sunan An Nisai Vol 1 Book 1 Hadith 21