وَاِذَا كُنْتَ فِيْهِمْ فَاَقَمْتَ لَهُمُ الصَّلٰوةَ فَلْتَقُمْ طَاۤىِٕفَةٌ مِّنْهُمْ مَّعَكَ وَلْيَأْخُذُوْٓا اَسْلِحَتَهُمْ ۗ فَاِذَا سَجَدُوْا فَلْيَكُوْنُوْا مِنْ وَّرَاۤىِٕكُمْۖ وَلْتَأْتِ طَاۤىِٕفَةٌ اُخْرٰى لَمْ يُصَلُّوْا فَلْيُصَلُّوْا مَعَكَ وَلْيَأْخُذُوْا حِذْرَهُمْ وَاَسْلِحَتَهُمْ ۗ وَدَّ الَّذِيْنَ كَفَرُوْا لَوْ تَغْفُلُوْنَ عَنْ اَسْلِحَتِكُمْ وَاَمْتِعَتِكُمْ فَيَمِيْلُوْنَ عَلَيْكُمْ مَّيْلَةً وَّاحِدَةً ۗوَلَا جُنَاحَ عَلَيْكُمْ اِنْ كَانَ بِكُمْ اَذًى مِّنْ مَّطَرٍ اَوْ كُنْتُمْ مَّرْضٰٓى اَنْ تَضَعُوْٓا اَسْلِحَتَكُمْ وَخُذُوْا حِذْرَكُمْ ۗ اِنَّ اللّٰهَ اَعَدَّ لِلْكٰفِرِيْنَ عَذَابًا مُّهِيْنًا ( النساء: ١٠٢ )
Wa izaa kunta feehim fa aqamta lahumus Salaata faltaqum taaa'ifatum minhum ma'aka walyaakhuzooo aslihatahum fa izaa sajadoo fal yakoonoo minw waraaa'ikum waltaati taaa'ifatun ukhraa lam yusalloo falyusallo ma'aka walyaakhuzoo hizrahum wa aslihatahum; waddal lazeena kafaroo law taghfuloona 'anaslihatikum wa amti'atikum fa yameeloona 'alaikum mailatanw waahidah; wa laa junaaha 'alaikum in kaana bikum azam mimmatarin aw kuntum mmardaaa an tada'ooo aslihatakum wa khuzoo hizrakum; innal laaha a'adda lilkaafireena 'azaabam muheenaa (an-Nisāʾ 4:102)
And when you [i.e., the commander of an army] are among them and lead them in prayer, let a group of them stand [in prayer] with you and let them carry their arms. And when they have prostrated, let them be [in position] behind you and have the other group come forward which has not [yet] prayed and let them pray with you, taking precaution and carrying their arms. Those who disbelieve wish that you would neglect your weapons and your baggage so they could come down upon you in one [single] attack. But there is no blame upon you, if you are troubled by rain or are ill, for putting down your arms, but take precaution. Indeed, Allah has prepared for the disbelievers a humiliating punishment. (An-Nisa  : 102)
1 Mufti Taqi Usmani
When you (O prophet) are in their midst, and arrange for them the Salāh, then, a party from them should stand with you, and should take their arms along. Then, once they performed Sajdah, they should move away from you, and the other party, that has not yet performed Salāh, should come and perform Salāh with you, and should take their precautionary measures and their arms. Those who disbelieve would want you to become heedless to your arms and your belongings, so that they come down upon you in a single move. There is no sin on you, if you have some inconvenience due to rain, or you are sick, in putting your arms aside, but take your precautionary measures. Surely, Allah has prepared for the disbelievers a humiliating punishment.