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