This is what our teacher, the Rema, wrote in section 1: that a shaliach tzibbur who prays in the beit knesset or in a house and there is tzoah there, even if it is behind him and far from him – he must remain silent until it is removed, since he fulfills the obligation of the many, and it is impossible that there would not be some of the tzibbur within four amot of the tzoah. Thus far his words. That is to say: even if the tzoah is behind the entire tzibbur, nevertheless, certainly some of them are within four amot. And he was only concerned for the tzibbur, but for the shaliach tzibbur himself there is no concern even though they are in one room, and this is for the reason that has been explained. And that which he wrote: the measure of four amot – this is from the place where the odor ends. And so too if the tzoah intervenes between the tzibbur and the shaliach tzibbur – it is forbidden in any case, as I wrote above in siman 55 regarding the matter of answering "Amen," see there (Magen Avraham, subsection 3). And even though now every individual prays for himself, nevertheless, one must answer "Amen" to the blessings of the shaliach tzibbur (Eliyah Rabbah, subsection 6). Therefore, in Pesukei D'Zimrah, where he does not fulfill their obligation, and also there is no "Amen" here – it is permitted for the shaliach tzibbur to recite it when the tzoah is behind him at the distance that has been explained (ibid., and Magen Avraham ibid.). And regarding urine when it is in the beit knesset, and the entire congregation is four amot away from it – it is permitted for the shaliach tzibbur to pray (Turei Zahav, subsection 2).
וזהו שכתב רבינו הרמ"א בסעיף א דשליח ציבור המתפלל בבית הכנסת או בבית ויש שם צואה, אפילו הוא לאחריו ורחוק ממנו – צריך לשתוק עד שיוציאנה, מאחר שמוציא רבים ידי חובתן, ואי אפשר שלא יהיה מן הציבור בתוך ארבע אמות של הצואה. עד כאן לשונו. כלומר: אפילו אם הצואה הוא מלאחריהם של כל הציבור, מכל מקום וודאי יש מקצתן בתוך ארבע אמות. ולא חשש רק להציבור, אבל להשליח ציבור בעצמו אין שום חשש אף על פי שהם בחדר אחד, וזהו מהטעם שנתבאר. וזה שכתב: שיעור ארבע אמות – זה ממקום שכלה הריח. וכן אם הצואה מפסקת בין הציבור להשליח ציבור – אסור בכל ענין, כמו שכתבתי לעיל סימן נ"ה לענין עניית "אמן", עיין שם (מגן אברהם סעיף קטן ג'). ואף שעתה מתפלל כל יחיד בפני עצמו, מכל מקום הא צריך לענות "אמן" על ברכות שליח הציבור (אליה רבה סעיף קטן ו'). ולכן בפסוקי דזמרה שאינו מוציאם ידי חובתם, וגם אין כאן "אמן" – מותר להשליח ציבור לומר כשהצואה מאחוריו בהרחקה שנתבאר (שם, ומגן אברהם שם). ובמי רגלים כשיש בבית הכנסת, וכל הקהל רחוקים מהם ארבע אמות – מותר לו להשליח ציבור להתפלל (ט"ז סעיף קטן ב').