Abdullah bin Abbas reported,

They were a group during the time of the Messenger of Allah ﷺ who did not go out on military campaigns with him due to illnesses, diseases, and ailments. Others were healthy yet still did not join him on campaigns. The sick had a valid excuse, unlike the healthy.

Azami 7813

Sahih

في قول الله عزوجل: {لا يستوي القعدون من المؤمنين غير أولى الضرر}

عن ابن عباس قال

هم قوم كانوا على عهد رسول الله ﷺ لايغزون معه لأسقام، وأمراض، وأوجاع، وآخرون أصحاء لا يغزون معه، وكان المرضي في عذر من الأصحاء.

الأعظمي 7813صحيح
Contents
Reference
Commentary
Ayat
Collection
Jami al-Kamil
Book
Jihad
Chapter
Rulings on jihad and its etiquette
Section
Removal of the obligation of jihad from those with valid excuses
Numbering
Jami al-Kamil 7813 (2nd edition)
Azami 7813