The Shulchan Aruch · Orach Chayim
אורח חיים ל״דOrach Chayim 34
Siman 34 of 697 in Orach Chayim — 4 se'ifim
הלכות תפיליןLaws of Tefillin· siman 34
Se’if 1א׳
סֵדֶר הֲנָחָתָן בַּבָּתִּים, לְרַשִׁ"י וְהָרַמְבָּ"ם קַדֵּשׁ מִשְּׂמֹאל הַמֵּנִיחַ, בַּבַּיִת הַחִיצוֹן, וְאַחֲרָיו כִּי יְבִיאֲךָ בְּבַיִת שֵׁנִי, וּשְׁמַע בַּבַּיִת הַשְּׁלִישִׁי, וְהָיָה אִם שָׁמוֹעַ בַּבַּיִת הָרְבִיעִי, שֶׁהוּא בַּיִת הַחִיצוֹן לִימִינוֹ. וּלְרַבֵּנוּ תָּם בַּבַּיִת הַג' וְהָיָה אִם שָׁמוֹעַ, וּבַבַּיִת הַד' שֶׁהוּא הַחִיצוֹן שְׁמַע, וּמִנְהַג הָעוֹלָם כְּרַשִׁ"י וְהָרַמְבָּ"ם.
The order of the placement [of the head tefillin scrolls] in their compartments [is as follows]: per Rashi and Rambam, [the] "Kadesh" [scroll] goes in the compartment furthest to the left of the one wearing the tefillin, in the compartment on the left edge of the tefillin. After it is [the scroll] "Ki Yeviacha" in the second compartment [counting from the left of the wearer], and [the scroll] of "Shema" in the third compartment, and [the scroll of] "Vehayah Im Shamoa" in the fourth compartment, which is the external compartment on the wearer's right. According toe Rabbenu Tam, in the third compartment one places "Vehayah Im Shamoa" and in the fourth compartment - that is the external one - Shema. And the popularly accepted custom is to follow Rashi and Rambam's view.
Se’if 2ב׳
יְרֵא שָׁמַיִם יֵצֵא יְדֵי שְׁנֵיהֶם, וְיַעֲשֶׂה שְׁתֵּי זוּגוֹת תְּפִלִּין, וְיָנִיחַ שְׁנֵיהֶם, וִיכַוֵּן בַּהֲנָחָתָן בְּאוֹתָם שֶׁהֵם אַלִּבָּא דְּהִלְכְתָא אֲנִי יוֹצֵא יְדֵי חוֹבָתִי, וְהַשְּׁאָר הֵם כִּרְצוּעוֹת בְּעָלְמָא, כִּי מָקוֹם יֵשׁ בָּרֹאשׁ לְהָנִיחַ שְׁנֵי תְּפִלִּין, וְכֵן בַּזְּרוֹעַ וְאִם אֵינוֹ יוֹדֵעַ לְכַוֵּן הַמָּקוֹם וּלְהָנִיחַ שְׁנֵיהֶם יַחַד, יָנִיחַ כְּדִבְרֵי הָאֶחָד שֶׁל יָד וְשֶׁל רֹאשׁ (וִיסַלְּקֵם מִיָּד) וְיָנִיחַ הָאֲחֵרִים עַל סְמַךְ בְּרָכָה רִאשׁוֹנָה, וְאִם (וְיֵשׁ אוֹמְרִים) לֹא יוּכַל לְהָנִיחַ בְּבַת אַחַת, יָנִיחַ שֶׁל רַשִׁ"י, וִיבָרֵךְ עֲלֵיהֶם, וְיִהְיוּ עָלָיו בִּשְׁעַת קְרִיאַת שְׁמַע וּתְפִלָּה, וְאַחַר הַתְּפִלָּה יָנִיחַ שֶׁל רַבֵּנוּ תָּם בְּלֹא בְּרָכָה וְיִקְרָא בָּהֶם שְׁמַע וְהָיָה אִם שָׁמוֹעַ.
One who fears Heaven will seek to fulfill the commandment according to both views, by making two pairs of tefillin and wearing both. He shall have the intent upon putting them on that, "With the pair that correctly express the true halacha I am fulfilling my obligation, and the remainder are just ordinary straps." [And this is possible to do] as there is space on the head to wear two pairs of tefillin and likewise on the arm. If he does not know the precise place such that he could wear them both simultaneously, then he shall wear according to one view [the tefillin] of arm and head (outtake: and remove them immediately) and then place the other set [upon himself] in reliance on his initial blessing. If (outtake: and there are those who say) he cannot wear them both simultaneously, he should wear those [made according to] Rashi's view and bless upon them and they should be upon him at the time of reading Shema and the Tefilah [aka Shemoneh Esreh]. Then after the Tefilah he shall place tefillin of Rabbenu Tam without a blessing and read, while wearing them, [the paragraphs of] Shema and Vehayah Im Shamoa.
Se’if 3ג׳
לֹא יַעֲשֶׂה כֵן אֶלָּא מִי שֶׁמֻּחְזָק וּמְפֻרְסָם בַּחֲסִידוּת.
One shouldn't follow the above practice [of wearing two sets of tefillin, i.e. also wearing those of Rabbenu Tam] unless he is habituated in [muchzak translated per the basis of chazakah] and well-known for [his] piety.
Shulchan Aruch, Orach Chayim — Torat Emet 363 edition, via Sefaria — public domain
English: Sefaria Community Translation — CC0