Think of the object and it's placement to what it is you are referring. Let's look at these two sentences, which are identical with exception of the propositions in question.
You are in the school.
You are at the school.
In the first example, it describes you as being within the school building itself.In
In the second example, you are at the school. You might not be inside the school, but you could be on the school grounds, in the parking lot, or in fact inside the building as in example one. Again, the main point is, think of the objects to which you are referencing and their placement to one another.