I am at home.
I am in bed.
I am at school.
I am in the classroom.
It is in the wardrobe.
He cannot sleep at night.
She looked at you like you were to blame.
They were at war in 1986.
Definitions.
At: expressing location or arrival in a particular place or position, expressing the time when an event takes place.
In: expressing the situation of something that is or appears to be enclosed or surrounded by something else, expressing a period of time during which an event takes place or a situation remains the case.
I hope this explains it for you.