You use "in" when a region, usually with clear limits, exists. When you use "in the supermarket", the so-called limits are the walls of the building. "In the pool" suggests the sides of the pool, or at least the area of water.
You use "at" when you talk about a point in a longer journey. You [go to] a place, then you [are at] a place. If you travel from your office, to the pool, to the supermarket, and then to your house, then you use "at" when talking about the moments you were there.