I believe this is one of those situations where you cannot stick to your rules of prepositions and what they mean or how they differ form one another.
Saying, "he's at school" certainly doesn't mean he is outside the building; it means the same as "he's in school" or even less ambiguous - "he's attending school".
The same can be said of many prepositions - rules for differentiating aren't rules, merely guidelines. Why, for example, are you in a car, but on a bus?

