This is based on the Talmud on daf 94a. The following comment is adapted from the steinsaltz.org website:-
According to the Mishnah on daf 93b, someone who carries out a living person on a bed is exempt even for carrying out the bed, since the bed is secondary to the person. If, however, he carried out a corpse on a bed he would be liable for carrying on Shabbat.
The Gemara on daf 94a discusses why the individual who carries a living person is not liable. While the Gemara at first suggests that this is an individual opinion, with which the majority of the Sages disagree, ultimately Rava concludes that the disagreement is only about animals. Regarding animals the Sages believe that the animal deadens its weight in an attempt to free itself, but regarding people all agree that “a live person carries himself.” Therefore, one who carries a live person out is exempt according to all opinions.
Tosafot find this halakhah difficult and concluded that one who carries a living being is exempt, not because a living being carries itself while others are carrying it, but because it moves independently and is not typically carried. Since in the construction of the Tabernacle no living beings were carried, the prohibition of carrying out on Shabbat does not apply to living beings. The Tiferet Yisrael offers an alternative explanation, based on the teaching that we learned on daf 93. Perhaps one who carries a living being is exempt because the case falls under the rubric of “this person is capable, and this person is capable,” a case in which both are exempt. Even though, practically speaking, the living being that is being carried is not capable of “carrying himself” while being carried, given that he is neither bound nor ill, and theoretically he is capable of walking, it is as if both the living being and his carrier are participating in performance of the action.