Ampere's rule is a rule for the direction of deviation of a magnetic needle caused by the presence of a straight, electric-current carrying, wire. The rule was first formulated by Ampère, see for the physics background Biot-Savart's law.
The rule reads as follows: Let the open palm of your right hand face the magnetic needle. Direct your hand so that the current enters at your wrist and flows towards your fingers. Then the North Pole of the magnetic needle will deviate in the direction of the stretched thumb of your right hand.