It was narrated from Salim from his father, that:
The Messenger of Allah (ﷺ) led one of the two groups in praying one rak'ah while the other group was facing the enemy, then they moved away and took the place of the others, and the others came and he led them in praying the other rak'ah, then he said the salam and they stood up and made up the other rak'ah, and the others stood up and made up the other rak'ah.