ENOfficial
It was narrated from Thawban that: The Messenger of Allah (ﷺ) said: "No one among the Muslims should stand to pray when he is suppressing (the need to urinate or defecate), until he has to relieve himself."
Source: sunnah.com
Other translations
Arabic
حَدَّثَنَا مُحَمَّدُ بْنُ الْمُصَفَّى الْحِمْصِيُّ، حَدَّثَنَا بَقِيَّةُ، عَنْ حَبِيبِ بْنِ صَالِحٍ، عَنْ أَبِي حَىٍّ الْمُؤَذِّنِ، عَنْ ثَوْبَانَ، عَنْ رَسُولِ اللَّهِ ـ صلى الله عليه وسلم ـ أَنَّهُ قَالَ " لاَ يَقُومُ أَحَدٌ مِنَ الْمُسْلِمِينَ وَهُوَ حَاقِنٌ حَتَّى يَتَخَفَّفَ " .
sunnah.com