Sayyiduna Abu Bakrah (may Allah be pleased with him) said that the Messenger of Allah (peace and blessings be upon him) led some of his companions in two rak'ahs and then gave the salam. Then they moved back and the others came forward. The Prophet (peace and blessings be upon him) led them too in two rak'ahs and gave the salam. Thus the prayer of the Prophet (peace and blessings be upon him) was four rak'ahs and the prayer of the people was two rak'ahs each, that is, in the fear prayer.
Hadith Referenceالسنن الكبرى للبيهقي / كتاب صلاة الخوف / 6036