The Shulchan Aruch · Orach Chayim
אורח חיים מ׳Orach Chayim 40
Siman 40 of 697 in Orach Chayim — 8 se'ifim
הלכות תפיליןLaws of Tefillin· siman 40
Se’if 1א׳
אָסוּר לִתְלוֹת תְּפִלִּין בֵּין בַּבָּתִּים בֵּין בָּרְצוּעוֹת, אֲבָל מֻתָּר לִתְלוֹתָן בְּכִיסָן.
Laws regarding how to conduct oneself with the holiness of the Tefillin. Containing 8 paragraphs: It is forbidden to hang Tefillin, whether by the boxes or by the straps. But it is permitted to hang them [while they are] in their pouch.
Se’if 2ב׳
בַּיִת שֶׁיֵּשׁ בּוֹ תְּפִלִּין אָסוּר לְשַׁמֵּשׁ בּוֹ מִטָּתוֹ, עַד שֶׁיּוֹצִיאֵם אוֹ שֶׁיְּנִיחֵם בִּכְלִי תּוֹךְ כְּלִי, וְהוּא שֶׁאֵין הַשֵּׁנִי מְיֻחָד לָהֶם, שֶׁאִם הוּא מְיֻחָד, אֲפִלּוּ מֵאָה חֲשׁוּבִים כְּא': הַגָּה: וְאִם שְׁנֵיהֶם אֵינָן מְיֻחָדִים לָהֶם, אוֹ שֶׁהַפְּנִימִי אֵינוֹ מְיֻחָד לָהֶם, וְהַחִיצוֹן מְיֻחָד לָהֶם, מֻתָּר. וע"ל סי' ר"מ ס"ו. (בֵּית יוֹסֵף).
[Regarding] a house (ie. a room) which has תפילין in it... it is forbidden to engage in marital intercourse there until you remove them [from the room] or place them in a receptacle within another receptacle. And this [applies] where the second [receptacle] is not designated for them (ie. as a receptacle to store the תפילין)... for if it would be designated [for them], then even a hundred [receptacles] are considered like one (and it would still require another outer receptacle that's not designated for them). Rema: And if both of them are not designated for them, or the inner one is not designated for them and the outer one is designated for them, it is permitted. And see further in Siman 140, Se'if 6. (Beit Yosef)
Se’if 3ג׳
אֲפִלּוּ הֱנִיחָם בִּכְלִי בְּתוֹךְ כְּלִי, אָסוּר לַהֲנִיחָם תַּחַת מַרְגְּלוֹתָיו, וְכֵן אָסוּר לַהֲנִיחָם תַּחַת מֵרַאֲשׁוֹתָיו כְּנֶגֶד רֹאשׁוֹ, אֲפִלּוּ כְּלִי בְּתוֹךְ כְּלִי, וַאֲפִלּוּ אֵין אִשְׁתּוֹ עִמּוֹ. אֲבָל שֶׁלֹּא כְּנֶגֶד רֹאשׁוֹ, אִם אֵין אִשְׁתּוֹ עִמּוֹ, מֻתָּר, וְאִם אִשְׁתּוֹ עִמּוֹ צָרִיךְ כְּלִי בְּתוֹךְ כְּלִי.
Even when placing them in a receptacle within a receptacle, it is forbidden to place them by one's feet. And similarly, it's forbidden to place them under one's head [when they are] directly opposite his head... even [when they are] in a receptacle within a receptacle... and even if his wife is not with him. But [to place them under his head when they are] not directly opposite his head... if his wife is not with him, it's permitted... and if his wife is with him, it requires a receptacle within a receptacle.
Shulchan Aruch, Orach Chayim — Torat Emet 363 edition, via Sefaria — public domain
English: Sefaria Community Translation — CC0