The first thing to remember is a compass points in the direction of the magnetic field. This may seem confusing until you remember that the earth's north geographic pole is a south magnetic pole. Magnetic fields are defined as the direction a north mono-pole will move in a magnetic field. Therefore, a compass in a magnetic field will point in the direction of the magnetic field.

In the example of the Earth below we can see that the compass points to geographic north but because the compass needle that points that way is a north pole of a magnet the earths geographic pole must be a south magnetic pole to attract the north pole of the compass.