The rule is called Lenz's Law. You already appear to know how to determine the direction of the magnetic field due to a current in a loop, which is part of the answer. What Lenz's Law tells us is that the direction of the induced current in the loop is such that it "opposes the change in the flux".