The Adhaan has been pronounced. You’re thinking: ‘getting up in two minutes..’. You get late. The jama’ah (congregation) has started and you just reached the masjid. You run to join in.. STOP right there!
Narrated ‘Abdullah bin Abi Qatada:
My father said, “While we were praying with the Prophet, he heard the noise of some people. After the prayer he said, ‘What is the matter?’ They replied ‘We were hurrying for the prayer.’ He said, ‘Do not make haste for the prayer, and whenever you come for the prayer, you should come with calmness, and pray whatever you get (with the people) and complete the rest which you have missed.”
Narrated Abu Huraira:
The Prophet said, “When you hear the Iqama, proceed to offer the prayer with calmness and solemnity and do not make haste. And pray whatever you are able to pray and complete whatever you have missed.
If you joined in a congregation late (in the second/third rak’ah), you need not worry. Join the jama’ah and do as the rest are doing. For example, if they’re in ruku’, join them directly in ruku’ after saying your Allahu Akbar. When the Imaam says salam at the end, don’t say salam, stand up and complete the number of rak’aat you have missed. You’ll get the reward for praying with congregation even if you joined it in the last rak’ah. Mind you, don’t make it a habit! :)