As for your first question, we quote a fatwa by Sheikh Muhammad Salih Al-Munajjid, a prominent Saudi scholar, who states,


the correct scholarly view is that whatever the latecomer (who joins the prayer with the Jama`ah) catches up with, becomes the first part of his prayer. This is the view of Ash-Shaf`i (may Allah have mercy on him).

The Prophet (peace and blessings be upon him) said: “If you hear the Iqamah (call to start the Prayer) then walk to the prayer, and you must be calm and dignified, and do not hasten. Whatever you catch up with, pray, and whatever you miss, make it up.” (Al-Bukhari and Muslim). This is what is meant by whatever the latecomer who joins the prayer with the jama`ah catches up with, being the first part of his prayer.

On this basis, if the latecomer joins the imam in the second rak’ah of Maghrib prayer, then this rak’ah is the first for this person who joins them, and the third rak’ah for the jama`ah becomes the second rak’ah for the person praying behind him. Then when the imam says the Taslim (salutation of peace ending salah), the person behind him should stand up and complete his prayer, and this will be the third rak’ah for him, and he should recite al-Fatihah silently in it.