Anas bin Malik reported,

When the Messenger of Allah ﷺ returned from the expedition of Tabuk and drew near to Madinah, he said, "There are people in Madinah who were with you on every journey you made and every valley you crossed."They asked, "Messenger of Allah, even though they are in Madinah?"He replied, "Even though they are in Madinah. A valid excuse kept them behind."

Ibn Majah 2764

Sahih

حدثنا محمد بن المثنى حدثنا ابن أبي عدي عن حميد

عن أنس بن مالك قال

لما رجع رسول الله ﷺ من غزوة تبوك فدنا من المدينة قال إن بالمدينة لقوما ما سرتم من مسير ولا قطعتم واديا إلا كانوا معكم فيه قالوا يا رسول الله وهم بالمدينة قال وهم بالمدينة حبسهم العذر

ابن ماجه 2764صحيح
Contents
Reference
Commentary
Ayat
Collection
Sunan Ibn Majah
Book
Jihad
Chapter
Those held back from jihad by an excuse
Numbering
Darussalam 2764
Ibn Majah 2764