The Rambam · Sefer Zemanim
הלכות שופר וסוכה ולולב ב׳Shofar, Sukkah and Lulav 2
Chapter 2 of 8 in Shofar, Sukkah and Lulav — 10 halachot
Halacha 1א׳
הַכּל חַיָּבִין לִשְׁמֹעַ קוֹל שׁוֹפָר כֹּהֲנִים לְוִיִּים וְיִשְׂרְאֵלִים וְגֵרִים וַעֲבָדִים מְשֻׁחְרָרִים. אֲבָל נָשִׁים וַעֲבָדִים וּקְטַנִּים פְּטוּרִין. מִי שֶׁחֶצְיוֹ עֶבֶד וְחֶצְיוֹ בֶּן חוֹרִין וְטֻמְטוּם וְאַנְדְּרוֹגִינוּס חַיָּבִין:
All are obligated to hear the sound of the shofar — priests (Kohanim), Levites, Israelites, converts and freed slaves. But women, slaves and children are exempt. One who is half a slave and half a free person, one who has genitalia of both sexes and one whose genitalia are covered by a layer of skin (and, so, undetermined) are obligated.
Halacha 2ב׳
כָּל מִי שֶׁאֵינוֹ חַיָּב בַּדָּבָר אֵינוֹ מוֹצִיא אֶת הַחַיָּב יְדֵי חוֹבָתוֹ. לְפִיכָךְ אִשָּׁה אוֹ קָטָן שֶׁתָּקְעוּ בַּשּׁוֹפָר הַשּׁוֹמֵעַ מֵהֶן לֹא יָצָא. אַנְדְּרוֹגִינוּס מוֹצִיא אֶת מִינוֹ וְאֵינוֹ מוֹצִיא אֶת שֶׁאֵינוֹ מִינוֹ. טֻמְטוּם אֵינוֹ מוֹצִיא לֹא אֶת מִינוֹ וְלֹא שֶׁאֵינוֹ מִינוֹ. שֶׁהַטֻּמְטוּם שֶׁנִּקְרַע אֶפְשָׁר שֶׁיִּמָּצֵא זָכָר וְאֶפְשָׁר שֶׁיִּמָּצֵא נְקֵבָה:
Anyone who is not obligated in something may not serve as an agent to fulfill the obligation of one who is obligated. Hence one who hears a child or a woman who blew with a shofar has not fulfilled [his obligation]. One who has genitalia of both sexes may serve as an agent for its [own] type, but may not serve as an a agent for [those] not its type. One whose genitalia are covered by a layer of skin may neither serve as an agent for its type nor not its type. For [if the layer of skin] is torn, it is possible that it will be found to be a male and it is possible that it will be found to be a female (such that in actual fact, it is not really a different type, but rather definitively either male or female).
Halacha 3ג׳
וְכֵן מִי שֶׁחֶצְיוֹ עֶבֶד וְחֶצְיוֹ בֶּן חוֹרִין אֵינוֹ מוֹצִיא אֲפִלּוּ עַצְמוֹ שֶׁאֵין צַד עַבְדוּת שֶׁבּוֹ מוֹצִיא צַד חֵרוּת שֶׁבּוֹ. אֶלָּא כֵּיצַד יֵצֵא יְדֵי חוֹבָתוֹ. שֶׁיִּשְׁמַע מִבֶּן חוֹרִין שֶׁיִּתְקַע לוֹ:
And likewise one who is half a slave and half a free person may not even serve as an agent for himself. For the side of slavery in him may not serve as an agent for the side of freedom in him. So how can he fulfill his obligation? He should listen to a free man that will blow for him.
Mishneh Torah, Torat Emet 363 edition, via Sefaria — public domain
English: Sefaria Edition, tr. R. Francis Nataf, 2019 — CC BY