Siman 127
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 The Laws of Modim D'Rabbanan ["Modim of the Rabbis"]. Containing 2 S'ifim: When the prayer leader reaches "Modim", the congregation bows with [the leader], but they shouldn't bow [down] too far; and they say "We are thankful to You, (that You Hashem are) our God, God of all flesh etc."; and they conclude: "Blessed is the God of thanksgivings" without mentioning the [divine] Name. And there is one [authority] who says that one needs to also bow at the end, and it is proper to heed his words. (There are those who say that one should be bowing once while saying the entire thing, and that is the custom) (Piskei Mahari"a [R. Yisrael Isserlein])
ב אִם אֵין שָׁם כֹּהֲנִים, אוֹמֵר שְׁלִיחַ צִבּוּר: אֱלֹהֵינוּ וֵאלֹהֵי אֲבוֹתֵינוּ בָּרְכֵנוּ בַּבְּרָכָה הַמְשֻׁלֶּשֶׁת וְכו', עַד וַאֲנִי אֲבָרֲכֵם. וְאֵין הַצִּבּוּר עוֹנִין אַחֲרָיו אָמֵן, אֶלָּא כֵּן יְהִי רָצוֹן. הַגָּה: וְאֵין אוֹמְרִים אֱלֹהֵינוּ וֵאלֹהֵי אֲבוֹתֵינוּ וְכו' רַק בַּזְּמַן שֶׁרָאוּי לְבִרְכַּת כֹּהֲנִים וְלִשָּׂא כַּפַּיִם; וְנָהֲגוּ לוֹמַר בְּשַׁחֲרִית: שִׂים שָׁלוֹם וְכֵן כָּל זְמַן שֶׁאוֹמֵר אֱלֹהֵינוּ כו', אֲבָל בְּלָאו הָכֵי מַתְחִילִין: שָׁלוֹם רַב; וְיֵשׁ מַתְחִילִין שִׂים שָׁלוֹם בְּמִנְחָה שֶׁל שַׁבָּת, הוֹאִיל וּכְתִיב בֵּיהּ בְּאוֹר פָּנֶיךְ נָתַתָּ לָנוּ, שֶׁהִיא הַתּוֹרָה שֶׁקּוֹרִין בְּמִנְחָה בְּשַׁבָּת (הַגָּהוֹת מַיְמוֹנִי פֶּרֶק ח' מֵהִלְכוֹת תְּפִלָּה).
2 If there are no Kohanim there, the prayer leader says "Our God, and God of our ancestors, bless us with the threefold blessing etc." until "and I will bless them". And the congregation should not answer "Amen" after it, rather [they should say] "May it be Your will". Rema: We don't say "Our God, and God of our ancestors, etc." except at a time [of day] when it's suitable for the Kohanim to lift their hands [to bless the people]. And we practice is to say "Sim Shalom" in the morning prayer and any time that "Our God, etc." is said, but otherwise, we begin "Shalom Rav". And there are those who say "Sim Shalom" in the afternoon prayer on Shabbat since it says in it [i.e. in Sim Shalom] "by the light of Your countenance You gave us... [a Torah of Life]", which is referring to the Torah, from which we read during the afternoon prayer on Shabbat. (Hagahot Maimoni - chapter 8 in the Laws of Prayer)