Siman 38
Presented here for study, not as a practical ruling. The Shulchan Aruch rules by Sephardi custom, the Rema's glosses by Ashkenazi custom, and the Kitzur follows Ashkenazi custom. For a practical question, ask your rabbi.
א חוֹלֶה מֵעַיִם פָּטוּר מִתְּפִלִּין: הַגָּה: אֲפִלּוּ אֵין לוֹ צַעַר. אֲבָל שְׁאָר חוֹלֶה אִם מִצְטַעֵר בְּחָלְיוֹ, וְאֵין דַּעְתּוֹ מְיֻשָּׁב עָלָיו פָּטוּר וְאִם לָאו חַיָּב. (מָרְדְּכַי וְא"ח ומיי' פ"ד).
1 One who is ill in his intestines is dispensed from the [commandment to wear] tefillin. Rema: "Even if he is not in pain. However [regarding] all other sick people, if he is in pain due to his illness and his mind is not at ease, he is also dispensed [from the commandment]. Otherwise he is obligated."
ב מִי שֶׁבָּרִי לוֹ שֶׁאֵינוֹ יָכוֹל לְהִתְפַּלֵּל בְּלֹא הֲפָחָה, מוּטָב שֶׁיַּעֲבֹר זְמַן הַתְּפִלָּה מִמַּה שֶּׁיִּתְפַּלֵּל בְּלֹא גּוּף נָקִי וְע"ל סי' פ'. וְאִם יֵרָאֶה לוֹ שֶׁיּוּכַל לְהַעֲמִיד עַצְמוֹ בְּגוּף נָקִי בִּשְׁעַת קְרִיאַת שְׁמַע, יָנִיחַ תְּפִלִּין בֵּין אַהֲבָה לִקְרִיאַת שְׁמַע, וִיבָרֵךְ.
2 One to whom it is clear that he cannot pray without flatulating, it is better that the time for Tefilah (the Shemoneh Esreh) should pass rather than that he should pray without a clean body. (And see further section 80.) And if it appears to him that he will be able to control himself to have a clean body [i.e. not flatulate] at the time of reading the Shema, he should put on tefillin between [the blessing just prior to Shema, ending in] Beahava and Shema, and bless [upon the tefillin].
ג נָשִׁים וַעֲבָדִים פְּטוּרִים מִתְּפִלִּין, מִפְּנֵי שֶׁהוּא מִצְוַת עֲשֵׂה שֶׁהַזְּמַן גְּרָמָא: הַגָּה: וְאִם הַנָּשִׁים רוֹצִים לְהַחְמִיר עַל עַצְמָן מוֹחִין בְּיָדָם (כָּל בּוֹ).
3 Women and slaves are exempt from Tefillin because it is a positive commandment which is caused by time. Rema: And if the women want to be stringent for themselves, we protest against it (Kol Bo).
ד הַמֵּנִיחַ תְּפִלִּין צָרִיךְ לִזָּהֵר מֵהִרְהוּר תַּאֲוַת אִשָּׁה: הַגָּה: וְאִם אִי אֶפְשָׁר לוֹ בְּלֹא הִרְהוּרִים מוּטָב שֶׁלֹּא לַהֲנִיחָם (כָּל בּוֹ וְא"ח).
4 One who wears tefillin must be cautious to avoid thoughts about desire for a woman. Rema: And if it's impossible for him not to think [about this desire] it is better not to put on tefillin.
ה אָבֵל בְּיוֹם רִאשׁוֹן אָסוּר לְהָנִיחַ תְּפִלִּין, מִכָּאן וָאֵילָךְ חַיָּב, אֲפִלּוּ בָּאוּ פָּנִים חֲדָשׁוֹת.
5 A mourner in the first day [of the seven days of mourning] is prohibited from wearing tefillin. From here [the second day] onwards he is obligated, even if "new faces" came (ie. people that came to comfort him who hadn't been there before).
ו בְּט' בְּאָב חַיָּבִין בִּתְפִלִּין וע"ל סי' תקנ"ה.
6 On the ninth of Av we are obligated in tefillin. (See further section 555.)
ז חָתָן וְשׁוֹשְׁבִינָיו (פֵּרוּשׁ רֵעָיו הַשְּׂמֵחִים עִמּוֹ) וְכָל בְּנֵי חֻפָּה פְּטוּרִין, מִשּׁוּם דְּשָׁכִיחַ שִׁכְרוּת וְקַלּוּת רֹאשׁ.
7 A groom and his guests (meaning his friends and those rejoicing with him) and all the participants in the Chupah are dispensed [from tefillin] given that we commonly find [in such situations] drunkenness and levity.
ח כּוֹתְבֵי תְּפִלִּין וּמְזוּזוֹת, הֵם וְתַגָּרֵיהֶם וְתַגָּרֵי תַּגָּרֵיהֶם, וְכָל הָעוֹסְקִים בִּמְלֶאכֶת שָׁמַיִם פְּטוּרִין מֵהֲנָחַת תְּפִלִּין כָּל הַיּוֹם, זוּלַת בִּשְׁעַת קְרִיאַת שְׁמַע וּתְפִלָּה: הַגָּה: וְאִם הָיוּ צְרִיכִים לַעֲשׂוֹת מְלָאכְתָן בִּשְׁעַת קְרִיאַת שְׁמַע וּתְפִלָּה אָז פְּטוּרִין מִקְּרִיאַת שְׁמַע וּמִתְּפִלָּה וּמִתְּפִלִּין, דְּכָל הָעוֹסֵק בְּמִצְוָה פָּטוּר מִמִּצְוָה אַחֶרֶת, אִם צָרִיךְ לִטְרֹחַ אַחַר הָאַחֶרֶת, אֲבָל אִם יָכוֹל לַעֲשׂוֹת שְׁתֵּיהֶן כְּאַחַת בְּלֹא טֹרַח, יַעֲשֶׂה שְׁתֵּיהֶן (הַגָּהוֹת אֲשֵׁרִי בְּשֵׁם אוֹר זָרוּעַ וְרַ"ן פ' הַיָּשֵׁן).
8 Scribes writing tefillin and mezuzot, them, their distributors and their distributors' distributors, and all those involved in the work of Heaven, are dispensed from wearing tefillin all day long, except [that they must wear them] at the time of reading Shema and [of] the Tefilah (Shemoneh Esreh). Rema: And if they had to do their work at the time of reading Shema and of the Tefilah, they are dispensed of Shema and Tefilah and tefillin, for everyone who is involved in a mitzvah is dispensed from engaging in another mitzvah if one has to make an effort for the other mitzvah. However if he can do both mitzvot without exerting himself, he should do both. (Quoted from Hagahot Ashrey in the name of Or Zarua and RaN on the Talmudic Chapter "The Sleeper.")
ט מִצְטַעֵר וּמִי שֶׁאֵין דַּעְתּוֹ מְיֻשֶּׁבֶת עָלָיו וּנְכוֹנָה פָּטוּר, מִפְּנֵי שֶׁאָסוּר לְהַסִיחַ דַּעְתּוֹ מֵהֶם.
9 On who is distressed, and one who's mind is not settled and ready is exempt [from תפילין] since it is forbidden to take one's mind off of them.
י הַקּוֹרֵא בַּתּוֹרָה פָּטוּר מֵהֲנָחַת תְּפִלִּין כָּל הַיּוֹם, זוּלַת בִּשְׁעַת קְרִיאַת שְׁמַע וּתְפִלָּה.
10 One who reads from the Torah (ie. he is in the middle of learning Torah) is exempt from wearing תפילין the entire day, except for when he is saying Shema and Tefillah (ie. Shmonah Esrei).
יא לֹא יַחֲלֹץ תְּפִלִּין בִּפְנֵי רַבּוֹ, אֶלָּא יִפְנֶה לְצַד אַחֵר מִפְּנֵי אֵימָתוֹ, וְיַחֲלֹץ שֶׁלֹּא בְּפָנָיו.
11 One should not remove his תפילין in front of his rabbi, rather he should face a different direction because [he should display] fear/reverence [before him]... and [then] remove them [while] not facing him.
יב הָיָה צָרִיךְ לִתְפִלִּין וּמְזוּזָה, וְאֵין יָדוֹ מַשֶּׂגֶת לִקְנוֹת שְׁנֵיהֶם, תְּפִלִּין קוֹדְמִים.
12 If one needed תפילין and a מזוזה, and he could not afford to buy both, the תפילין takes precedence.
יג מְנֻדֶּה וּמְצֹרָע אֲסוּרִים לְהָנִיחַ תְּפִלִּין:
13 A person who was excommunicated and a leper are forbidden to wear תפילין.