סימן יא סעיף ד
שְׁנֵי בָתִּים אֲשֶׁר לְכָל אֶחָד יֵשׁ פֶּתַח לִרְשׁוּת הָרַבִּים אוֹ לֶחָצֵר, וּבַמְּחִיצָה אֲשֶׁר בֵּינֵיהֶם יֵשׁ גַּם לְכָל אֶחָד פֶּתַח לִרְשׁוּת הָרַבִּים אוֹ לֶחָצֵר, וְהַשְּׁתָּא יֵּשׁ לְהִסְתַּפֵּק בְּפֶתַח זֶה בְּאֵיזֶה צַד יִתֵּן אֶת הַמְּזוּזָה אָזְלֵינַן בָּזֶה בָּתַר הֶכֵּר צִיר. פֵּרוּשׁ, בִּמְקוֹם שֶׁנַּעֲשִׂים הַצִּירִים לְהַדֶּלֶת שֶׁהַדֶּלֶת נִפְתַּחַת לְתוֹכוֹ, זֶהוּ עִקַּר הַבָּיִת, וְנוֹתְנִים אֶת הַמְּזוּזָה בְּצַד הַיָּמִין שֶׁנִּכְנָסִים לְתוֹכוֹ. וְדַוְקָא כְּשֶׁשְּׁנֵי הַבָּתִּים שָׁוִים בְּתַשְׁמִישָׁם. אֲבָל אִם אֶחָד הוּא עִקַּר תַּשְׁמִישׁוֹ, בָּזֶה לֹא אָזְלֵינַן בָּתַר הֶכֵּר צִיר, אֶלָּא לְעוֹלָם נוֹתְנִין אֶת הַמְּזוּזָה בְּצַד הַיָּמִין שֶׁנִּכְנָסִים לְהַבַּיִת אֲשֶׁר עִקַּר תַּשְׁמִישׁוֹ שָׁם, אֲפִלּוּ הַדֶּלֶת נִפְתַּחַת לְתוֹךְ הַשֵּׁנִי.
If there are two houses and each house has its own doorway which opens to either a public domain or to a courtyard and in the partition between the houses there is also a door, we must now deliberate how to regard this door, regarding the proper side to affix the mezuzah. We are guided by the location of the hinges, that is: the side where the hinges are attached and toward which the door opens. This is considered the main part of the house, and we place the mezuzah on the right side (of the doorway) which serves as the point of entry. This rule applies only when the two houses are used equally, but if one of the houses is the main place of utility, we are not guided by the position of the hinges; but should always place the mezuzah on the right side of the entrance to the house which is the main place of utility. This applies even if the door opens into the second house.
תנא דבי אליהו כל השונה הלכות בכל יום מובטח לו שהוא בן העולם הבא שנאמר הליכות עולם לו אל תקרי הליכות אלא הלכות (נדה ע"ג.)