This should be well explained in any EM book.
Anyways, you take a closed loop. B(r) is the field at any point on the loop. You find the line integral of B over the closed loop and that happens to be equal to uIenc.
If you knew vector calculus, you'd be able to derive this from the (differential) Maxwell equation.
This is the magnetism equivalent of the Gauss law of electrostatics. You can use it to obtain the magnetic field around symmetric current distributions, such as a wire.