For a country, state or big city, you use 'in'. For a small place you use 'at'.
I live in Malaysia; he lives in Pahang; They live in New York.
Ahmad lives at Kampong Chamang in Bentong.
I was at home when he called.
Others uses of 'in' 'at' 'on'.
I put the book on the table.
My brother took it and put it into the drawer.
He was standing at the door.
He aims at the mark.
We agree to meet at noon.
To know more, refer to a good dictionary.
Student or Learner