Anas reported
A Bedouin urinated in the mosque. Some of the persons stood up (to reprimand him or to check him from doing so), but the Messenger of Allah (ﷺ) said: Leave him alone; don't interrupt him. He (the narrator) said: And when he had finished, he called for a bucket of water and poured it over.
Anas b. Malik narrated that a desert Arab (Bedouin) stood in a corner of the mosque and urinated there. The people (the Companions of the Prophet who were present there) shouted, but the Messenger of Allah (ﷺ) said
Leave him alone. When he had finished, the Messenger of Allah (ﷺ) ordered that a bucket (of water) should be brought and poured over it.
Anas b. Malik reported
While we were in the mosque with Allah's Messenger (ﷺ), a desert Arab came and stood up and began to urinate in the mosque. The Companions of Allah's Messenger (ﷺ) said: Stop, stop, but the Messenger of Allah (ﷺ) said: Don't interrupt him; leave him alone. They left him alone, and when he finished urinating, Allah's Messenger (ﷺ) called him and said to him: These mosques are not the places meant for urine and filth, but are only for the remembrance of Allah, prayer and the recitation of the Qur'an, or Allah's Messenger said something like that. He (the narrator) said that he (the Holy Prophet) then gave orders to one of the people who brought a bucket of water and poured It over.