in the school - under the roof of the school building (said of a person OR thing)
at the school - in or near the school building (said of a person OR thing)
in school - being educated in or at a school; occupied with being educated ( said of a person)
at school - located at a school; attending a class in a school (said of a person)
You can say that there is an auditorium in the school, but the auditorium is not in school or at school. You can say that there is a playground at the school, but the playground is not in school or at school. Auditoriums and playgrounds cannot be educated or attend classes.
https://www.englishforums.com/English/InAt/hrvhg/post.htm
When we think of someone who is enrolled as a student, we use "in school". My five-year old will be in school for the first time this fall. Did you see that little kid running around in the neighbor's yard? Believe it or not, he's already in school. Summer is over. Now all the children are in school again. Paul! I hear you took a job with IBM after graduating from high school. -- No, actually I'm still in school. I'm attending the University of Wyoming. I'm just in California now for a week's vacation, so I'm not at school now. We think of someone who is physically present on the grounds of the school, whether outside or inside of the school, participating in the activities of the school, we use "at school". I wonder what Johnny is doing at school today. What kinds of things do you do at school? Do you play football at school? Where is your little daughter? -- She's at school. -- On Saturday? --Yes; they're at school rehearsing a play she's in. When we think of someone physically inside the school building, we use "in school" or "at school". Most students are in school at this hour of the day. Most students are at school at this hour of the day. (These illustrate usage in American English.)
https://www.englishforums.com/English/InSchoolAtSchool/xvgw/post.htm