(a) What is the direction of magnetic field lines inside a bar magnet and out side of it ? (b) What does the degree of closeness of the field lines represents ?
This is not a rule in general rather this is a short cut to find the direction of the deflection of the needle of the magnetic compass needle when kept in some magnetic field produced by some current carrying wire.
S---south (direction of current in the wire)
N---north
O---over (the location of the wire)
W---west (deflection)