If the Resident prays behind the Traveller
Question:
If a person went out on a journey and wished to pray the Zuhr prayer in congregation, and he found a person who had already performed the Zuhr prayer, but he was a resident. May the resident pray with the traveller, and should he shorten his prayers, or complete them?
Answer:
If the resident prays behind the traveller, seeking the reward of congregational pray, and he has already performed the obligatory prayer, he should pray two Rakahs, like the traveller, because it is considered a supererogatory prayer for him. But if the resident prays behind the traveller and he is performing an obligatory prayer such as Zuhr, Asr or Isha, then he should pray four Rakahs. In that case, he must complete his prayer when the traveller makes his Taslim after two Rakahs. However, if the traveller performs a prayer which is obligatory for both of them behind the resident, then he must complete four Rakahs, according to the most authoritative of two sayings held by the scholars, based upon the narration of Imam Ahmad and that of Imam Muslim in his Sahih - may Allaah have mercy on them both- which states that Ibn Abbas, may Allaah be pleased with him, was asked about a traveller who prays four Rakahs behind the Imam and two Rakahs with his (travelling) companions, and he said: That is the Sunnah. And also the generality of the words of the Prophet (sallallaahu alaihi wa sallam): The Imam is there is be followed, so do not contradict him.
Source:
Shaykh `Abdul-`Azeez Bin Baz
Fatawa Islamiyah Vol. 2 Page 153