The Shulchan Aruch · Orach Chayim
אורח חיים נ״הOrach Chayim 55
Siman 55 of 697 in Orach Chayim — 22 se'ifim
הלכות ברכות השחר ושאר ברכותLaws of Morning Blessings· siman 55
Se’if 1א׳
אוֹמְרִים קַדִּישׁ וְאֵין אוֹמְרִים אוֹתוֹ בְּפָחוֹת מִי' זְכָרִים בְּנֵי חוֹרִין גְּדוֹלִים שֶׁהֵבִיאוּ ב' שְׂעָרוֹת, וְהוּא הַדִּין לִקְדֻשָּׁה וּבָרְכוּ שֶׁאֵין נֶאֱמָרִין בְּפָחוֹת מֵעֲשָׂרָה.
The say Kaddish, and it is not said with less than ten males, who are free and have grown two [pubic] hairs, and this is the rule for Kedushah and Barchu that are not said with less than ten.
Se’if 2ב׳
אִם הִתְחִיל לוֹמַר קַדִּישׁ אוֹ קְדֻשָּׁה בַּעֲשָׂרָה וְיָצְאוּ מִקְּצָתָן, גּוֹמְרִים אוֹתוֹ הַקַּדִּישׁ אוֹ אוֹתָהּ הַקְּדֻשָּׁה שֶׁהִתְחִיל, וְהוּא שֶׁנִּשְׁתַּיְּרוּ רֻבָּן: הַגָּה: וּמִכָּל מָקוֹם עֲבֵרָה הוּא לָצֵאת, וַעֲלֵיהֶם נֶאֱמַר וְעוֹזְבֵי ה' יִכְלוּ (יְרוּשַׁלְמִי), אֲבָל אִם נִשְׁאֲרוּ י' מֻתָּר לָצֵאת (מָרְדְּכַי פ' בַּתְרָא דִּמְגִלָּה):
If the chazzan started kaddish or kedusha with 10 people and a few left he can finish the kaddish and kedusha that he started as long as the majority of them remain. Rem"a: Nevertheless, it is a sin to leave. And regarding that, the verse says: "...and those who forsake the Lord shall perish" (Isaiah 1:28) [Yerushalmi]. But if there are 10 people remaining it is allowed [Mordechi in the last chapter of Tractate Megillah].
Se’if 3ג׳
אִם הִתְחִיל בְּאָבוֹת וְיָצְאוּ מִקְּצָתָן, גּוֹמֵר אֲפִלּוּ קְדֻשָּׁה: הַגָּה: וְאִם יָצְאוּ מִקְּצָתָן לְאַחַר שֶׁהִתְחִילוּ לְהִתְפַּלֵּל יוֹצֵר, לֹא יַתְחִיל הַשְּׁלִיחַ צִבּוּר לְהִתְפַּלֵּל הַתְּפִלָּה בְּקוֹל רָם, דִּכְבָר נִשְׁלַם תְּפִלַּת יוֹצֵר, וְאִם יָצְאוּ לְאַחַר שֶׁהִתְחִיל בַּתְּפִלָּה בְּקוֹל רָם וּקְדֻשָּׁה, יְכוֹלִים לְהַשְׁלִים כָּל סֵדֶר קְדֻשָּׁה וְלוֹמַר הַקַּדִּישׁ שָׁלֵם שֶׁלְּאַחֲרֶיהָ, דְּשַׁיָּךְ לַתְּפִלָּה, שֶׁהֲרֵי אוֹמֵר תִּתְקַבַּל צְלוֹתְהוֹן וְכו', אֲבָל אֵין קוֹרִין בַּתּוֹרָה, דְּזֶהוּ עִנְיָן אַחֵר, וּתְפִלַּת עַרְבִית וְקַדִּישׁ שֶׁלְּאַחֲרָיו לֹא שַׁיָּךְ לִקְרִיאַת שְׁמַע וּבִרְכוֹתֶיהָ (רַ"ן פֶּרֶק הַקוֹרֵא אֶת הַמְּגִלָּה שִׁבּוֹלֵי הַלֶּקֶט וְת"ה סי' ט"ו).
If [the chazzan] started with [the blessing of] Avot [in the Amidah] and a few people left, he can finish even Kedusha. Rem"a: If a few of them left after they began to pray "Yotzer Ohr", the prayer-leader should not begin to pray the audible [Amidah repetition] prayer because he already completed the prayer of Yotzer. And if they left after he began the audible [Amidah repetition] and Kedusha, they can complete the entire order of Kedusha and say the full Kaddish that comes after it because it belongs to the [Amidah] Prayer, in that behold it says "may their prayer be accepted..." [in the Kaddish]. But they may not read from the Torah (ie. when some left and you are now left with less than 10 men) because this is a different matter. And the evening [Amidah] Prayer and the Kaddish that comes after it - they do not belong to the recitation of the Sh'ma and its blessings. [Ran on the chapter "the one who reads the Megillah"; Shibolei Ha-Leket ... chapter 15]
Shulchan Aruch, Orach Chayim — Torat Emet 363 edition, via Sefaria — public domain
English: Sefaria Community Translation — CC0