Sayyiduna Jabir bin Abdullah (may Allah be pleased with them both) said: We came with the Prophet (peace and blessings be upon him) to Dhat al-Riqa'. Whenever we came to a shady tree, we would leave it for the Prophet (peace and blessings be upon him). A man from the polytheists came while his (peace and blessings be upon him) sword was hanging from a tree. He took hold of the sword of the Prophet (peace and blessings be upon him), drew it, and said to the Messenger of Allah (peace and blessings be upon him): Are you afraid of me? He (peace and blessings be upon him) said: "No." He said: Who will protect you from me? He (peace and blessings be upon him) said: "Allah! He will protect me from you." The Companions of the Messenger of Allah (peace and blessings be upon him) threatened him. He put the sword back into its sheath and hung it on the tree. The call to prayer was given, and he (peace and blessings be upon him) led one group in two rak'ahs. Then they moved back, and the Prophet (peace and blessings be upon him) led the other group in two rak'ahs. Thus the Prophet (peace and blessings be upon him) had four rak'ahs and the people had two rak'ahs each.
Hadith Referenceالسنن الكبرى للبيهقي / كتاب صلاة الخوف / 6033
Sayyiduna Jabir bin Abdullah (may Allah be pleased with them both) said that the Messenger of Allah (peace and blessings be upon him) led his Companions in prayer: one group prayed with him (peace and blessings be upon him) while the other group was facing the enemy. He (peace and blessings be upon him) led them in two rak'ahs; then they went and stood facing the enemy. The others came, and he (peace and blessings be upon him) led them in two rak'ahs and gave the salam.
Hadith Referenceالسنن الكبرى للبيهقي / كتاب صلاة الخوف / 6034
Sayyiduna Jabir bin Abdullah (may Allah be pleased with them both) said that the Messenger of Allah (peace and blessings be upon him) led his Companions in two rak'ahs and then gave the salam; then he (peace and blessings be upon him) led the other group in two rak'ahs and then likewise gave the salam.
Hadith Referenceالسنن الكبرى للبيهقي / كتاب صلاة الخوف / 6035
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
Mu'adh bin Mu'adh (may Allah have mercy on him) narrates from Ash'ath (may Allah have mercy on him) concerning Zuhr, and al-Hasan (may Allah have mercy on him) used to give the fatwa concerning Maghrib that the imam will have six rak'ahs and the followers three rak'ahs each.
Some people narrated it from Ash'ath concerning Maghrib as marfu' (attributed to the Prophet (peace and blessings be upon him)), and I can only think that he was mistaken in that.
Hadith Referenceالسنن الكبرى للبيهقي / كتاب صلاة الخوف / 6037
Sayyiduna Abu Bakrah (may Allah be pleased with him) narrates that the Prophet (peace and blessings be upon him) led the people in the Maghrib prayer in fear, three rak'ahs. Then they left, and the other group came, and he (peace and blessings be upon him) led them too in three rak'ahs of prayer.
Hadith Referenceالسنن الكبرى للبيهقي / كتاب صلاة الخوف / 6038