This question already has an answer here:
Can someone explain properly according to Fiqh when someone is late to join the Imam in congregation prayer, how to proceed with it? Most places explain that someone needs to make it up whatever he/she misses. So if I join in 2nd raka’ with Imam which is my 1st raka’, Imam will sit for 1st tashahud, and then will continue the 3rd and 4th raka’. I will follow him exactly but I will miss my 1st tashahud. Will my prayer be valid without 1st tashahud? Or Imam’s tashahud will be considered as my 1st tashahud as well, although it will be my 1st raka’. Also if I join in 4th raka’ with Imam, should I sit in my 2nd raka’ for 1st tashahud after I will stand up when the Imam will do salam.