It was narrated from Bilal bin Al-Harith Al-Muzani that:
When the Messenger of Allah wanted to relieve himself, he would go far away. (ES)
English reference (ES): Vol. 1, Book 1, Hadith 336 (ES)
Arabic reference (ES): Book 1, Hadith 360 (ES)