1) One who enters the synagogue and hears the congregation answering “Yehei shemeih etc.”, should answer with them from “Yehei shemeih etc.” but not say “Amen” as that refers to the cantors “Yisgadal etc.”. If most of the congregation are still saying “Amen”, and he can concentrate on what he is responding “Amen”, he may also say “Amen”. (Shulchan Aruch 56)
2) For Kedushah as well, if he enters and the congregation is in the middle of Kedushah, he may answer with them. (ibid)