Fasting is obligatory on the:
- Muslim
- Bāligh (attained physical & cognitive maturity)
- Sane (cognitive maturity & the capacity to understand the obligation, its fulfilment and reward)
- Resident (not travelling or able to fast while in Travel)
- Able
- Free of valid Sharʿī excuse(s)
As regards those who do not fall in the above categories…
Disbeliever
Fasting is not obligatory and there is no spiritual reward assigned for performing it.
Pre-pubert (minor)
Not obligatory but recommended if able to sustain the fast.
Mentally incapacitated:
None of the Islamic pillars are obligatory on them with the exception zakāt (according to the majority view) being paid by those financially responsible for their estate.
Traveller
Permitted to break the fast but is required to make up for it later.