Caution: Translations of Quran and Ḥadīth may lead to possible misapplications and misinterpretations. This site is intended for students of sacred knowledge that are proficient in comprehending classical Arabic and have a strong foundation in Islamic sciences. Also note that religious injunctions rely on several aspects beyond what one may glean through reading individual aḥādīth.
quran:9:83

If Allah should return you to a faction of them ˹after the expedition˺ and then they ask your permission to go out ˹to battle˺, say, "You will not go out with me, ever, and you will never fight with me an enemy. Indeed, you were satisfied with sitting ˹at home˺ the first time, so sit ˹now˺ with those who stay behind."  

So if God brings you back, from Tabūk, to a party of them, of those hypocrites who stayed behind in Medina, and they ask leave of you to go forth, with you on some other campaign, say, to them: ‘You shall never more go forth with me, and you shall never fight with me against an enemy. You were content to stay behind the first time, so stay behind with those who stay behind’, away from ˹military˺ campaigns, such as women and children and others.
القرآن:٩:٨٣

فَإِنْ رَجَعَكَ اللَّهُ إِلَىٰ طَائِفَةٍ مِنْهُمْ فَاسْتَأْذَنُوكَ لِلْخُرُوجِ فَقُلْ لَنْ تَخْرُجُوا مَعِيَ أَبَدًا وَلَنْ تُقَاتِلُوا مَعِيَ عَدُوًّا ۖ إِنَّكُمْ رَضِيتُمْ بِالْقُعُودِ أَوَّلَ مَرَّةٍ فَاقْعُدُوا مَعَ الْخَالِفِينَ  

{فإنْ رجعك} ردك {الله} من تبوك {إلى طائفة منهم} ممن تخلف بالمدينة من المنافقين {فاستأذنوك للخروج} معك إلى غزوة أُخرى {فقل} لهم {لن تخرجوا معي أبدا ولن تقاتلوا معي عدوا إنكم رضيتم بالقعود أول مرة فاقعدوا مع الخالفين} المتخلفين عن الغزو من النساء والصبيان وغيرهم.