The Tur and the Shulchan Aruch further wrote in section 4 (Shulchan Aruch Yoreh Deah 371:4): A courtyard surrounded by moldings and porticos, and tumah is in one of the houses—if all the doorways of the houses and the windows are locked, tumah exits to beneath the moldings and the porticos. And if a window or doorway was opened on the other side, and those on the courtyard side are all locked, the tumah does not exit to beneath the moldings. And if one of them was also opened toward the side of the tumah, it exits from the house to beneath the moldings. And likewise, if tumah is beneath the moldings, it enters from beneath them into the house; and likewise roofs that protrude above outward over the doorways of the houses, and tumah is in one of the houses—all the houses whose doorways are open are tamei. Thus far their words, and this is the essence of the law of "the end of the tumah is to exit." And their words require clarification, and this is their explanation: that this courtyard is surrounded by moldings on one side, such as toward the street, and on the second side there are no moldings, and there is in every house a doorway toward the side of the moldings and a doorway toward the second side; therefore, when all the doors are locked—meaning primarily the doors that are on the second side, for as for the doors that are on the side of the moldings, it makes no difference if they are locked or open, obviously—and presumably they will take the deceased out by way of the moldings, therefore from now the tumah exits there by reason of "the end of the tumah is to exit." And likewise if they are all open, the law is so. But if those doors that are on the side of the moldings are locked, and on the second side one of them was opened, and this is a sign that they will take the deceased out through there, and if so there is no "the end of the tumah is to exit" by way of the moldings—they are tahor. However, if one doorway was also opened toward the side of the moldings—it is tamei. For the general principle of the matters is that when there is no proof, we say presumably they will take the deceased out through the doorway that is on the side of the moldings, for that is the primary exit. And only when there is proof that they will take him out from the second side, then it is tahor beneath the moldings. And that which they wrote, that when the tumah is beneath the moldings, the tumah enters all the houses open there—it is simple, for the ohel of the moldings brings the tumah. And it is simple that every doorway or window must have in its space four tefachim by four tefachim, for if not so, it is not a doorway at all.
עוד כתבו הטור והשולחן ערוך בסעיף ד (שולחן ערוך יורה דעה שעא, ד): חצר המוקפת זיזין ואכסדראות, וטומאה באחד מהבתים, אם כל פתחי הבתים והחלונות נעולים – טומאה יוצאה לתחת הזיזין והאכסדראות. ואם נפתח חלון או פתח מצד האחר, ואותם של צד החצר כולם נעולים – אין הטומאה יוצאה לתחת הזיזין. ואם נפתח אחד מהם גם כן לצד הטומאה – יוצאה מהבית לתחת הזיזין. וכן אם טומאה תחת הזיזין נכנסת מתחתיהן לבית, וכן גגים הבולטים למעלה לחוץ על פתחי הבתים, וטומאה באחד מהבתים – כל הבתים שפתחיהם פתוחים טמאים. עד כאן לשונם, וזהו עיקר דין "סוף טומאה לצאת". ודבריהם צריכים ביאור, והכי פירושם: דחצר זה מוקף זיזין לצד אחד כמו להרחוב, ובצד השני ליכא זיזין, ויש בכל בית פתח לצד הזיזין ופתח לצד השני; ולכן כשכל הדלתות נעולים, כלומר העיקר הדלתות שלצד השני דהדלתות שלצד הזיזין אין נפקא מינה אם הם נעולים או פתוחים כמובן, ומסתמא יוציאו המת דרך הזיזין, ולכן מעתה יוצאה הטומאה לשם מטעם "סוף טומאה לצאת". וכן אם כולם פתוחים הדין כך. אך אם אותם הדלתות שלצד הזיזין נעולים, ושלצד השני נפתח אחד מהם, וזהו סימן שדרך שם יוציאו המת, ואם כן אין "סוף טומאה לצאת" דרך הזיזין – טהורים. אמנם אם נפתח גם פתח אחד לצד הזיזין – טמא. דכלל הדברים דכשאין הוכחה, אמרינן מסתמא יוציאו המת דרך הפתח שלצד הזיזין, ששם הוא עיקר היציאה. ורק כשיש הוכחה שיוציאוהו מצד השני, אז טהור תחת הזיזין. וזה שכתבו שכשהטומאה תחת הזיזין, נכנסת הטומאה לכל הבתים הפתוחים שם – פשוט הוא דהאוהל של הזיזין מביא את הטומאה. ופשוט הוא דכל פתח או חלון צריך שיהיה בהחלל ארבעה טפחים על ארבעה טפחים, דאם לא כן אין זה פתח כלל.