Nafi' (may Allah have mercy on him) narrates from Sayyiduna Abdullah bin Umar (may Allah be pleased with them both) that when he prayed with the imam he would pray four rak'ahs, and when he prayed alone, two rak'ahs.
Hadith Referenceالسنن الكبرى للبيهقي / كتاب الصلاة / 5502
Abu Mijlaz (may Allah have mercy on him) said: I asked Sayyiduna Ibn Umar (may Allah be pleased with them both): A traveller catches two rak'ahs with the people (that is, with the residents); will the two rak'ahs suffice him, or should he pray the complete prayer as they do? Sayyiduna Ibn Umar (may Allah be pleased with them both) laughed and said: He should pray the complete prayer as they do, that is, he should complete four rak'ahs.
Hadith Referenceالسنن الكبرى للبيهقي / كتاب الصلاة / 5503