In reciting the verse, “Yih’yu l’ratzon…,” (“May the expressions of my mouth and the thoughts of my heart find favor before You, Hashem, my Rock, and my Redeemer”), which is said after the blessing for shalom, we end the main part of the Amidah. Therefore, if one hears Kaddish or Kedushah while he is between the berachah and that verse, he may not answer, because that verse is part of the Amidah (Shulchan Aruch and Rama 122:1).
However, from the beginning of Elokai netzor until the second time Yih’yu l’ratzon is recited, one is permitted to respond to Kaddish, Kedushah, Barchu, and Modim – like the law regarding one who is in the middle of Birkot Keriat Shema – because the person praying has already concluded the main part of the Amidah. Nevertheless, since he did not entirely finish the prayer, he is prohibited from answering Amen after berachot or anything similar (Shulchan Aruch there; and see Hilchot Birkot Keriat Shema 16:5).
As we have learned, it is in this section that one may extend his supplication and requests as much as he desires, like it is said about Rabbi Akiva, that when he would pray individually he would prolong his prayer with supplications following the Amidah (see Berachot 31a).[8]
Upon the conclusion of the prayers of supplication, the person praying recites Yih’yu l’ratzon again and takes three steps backwards. If he cannot step backwards because the person behind him is still praying, even though he has not yet departed from the Amidah, he may respond aloud to any matter of sanctity, even “Baruch Hu u’varuch Shemo,” since he already finished the supplications after the Amidah. Similarly, he is permitted to continue praying, reciting Ashrei and Aleinu L’Shabe’ach, or he may recite Psalms or learn Torah (see further in this chapter, halachah 20).