We use in when the noun or pronoun after it implies space with limits. Spaces with three dimensions.
In the house, in the country.
When it comes to time, in is used with periods of time.
In 2003. In the 18th. century.
We use at when the noun or pronoun after it conveys a point, that is, no dimensions.
at the party, at home
A party is an event. It has no dimensions. Home is in most cases an abstract idea, meaning the place were we belong or where we feel most comfortable.
It is similar when we talk about time.
We say at 10 a.m.
10 a.m only lasts one minute.
The use of prepositions may vary from country to country.
In Britain they say, at the weekend. In America, on the weekend.