Regarding saying complete or a part of tashahhud for the latecomer,Sheikh `Abdullah ibn `Abdul-`Aziz ibn `Uqail, a renowned Muslim scholar said,

If a latecomer joins the congregation in the third or the fourth rak`ah, the preponderant opinion in the hanbali madhab is that he or she should say only the first part of tashahhud (the second part of tashahhud is that which include sending prayers on the Prophet Muhammad) and it is recommendable to repeat it if there is a time, and after that he or she should complete the prayer after the Imam finishes the prayer. Imam Ahmad said regarding a Muslim who catches up the last rak`ah, “(He or she) is to repeat the first part of tashahhud and he (or she) should not send prayers on the Prophet or say and of the supplication said in the last tashahhud.