A child who is ill:[1] A child who is sick, or whose health may be compromised by performing a mitzvah, is exempt from chinuch in that mitzvah for the duration of the illness. Even though an adult who is merely uncomfortable would still be obligated, a child is not required to be educated in a way that may harm or endanger his health. Accordingly, a child who is very cold, weak, or likely to become ill is not required to sleep in the Sukkah. Likewise, a child is not educated to fast on Yom Kippur before the appropriate age, since fasting is not befitting for his physical well‑being. We find the halachic basis for this leniency in several areas, including the exemption of a child from sleeping in the Sukkah when it may cause illness and the exemption from fasting on Yom Kippur. Additionally, some Poskim rule that it is permitted for a child to transgress a rabbinic prohibition for his own legitimate need. Based on this principle, it is permitted for a child to eat kitniyot on Pesach if he is ill, even when the illness is not life‑threatening, as explained in another chapter.
[1] Admur 269:3; 343:7; 616:5; Michaber 616:1; M”A 269:1; Yuma 78b; Piskeiy Teshuvos 343:7