Specific note that is not clear for me in and the derivation of maxwell equation $\oint \vec{B} \cdot d \vec{r}=\mu_{0} I_{e n c}$ I know this is not the full equation but right now in this path of the course that what we learned so far.
We studied that a wire along the $z$ axis produces magnetic field $\vec{B}=\frac{\mu_{0} I}{2 \pi \rho} \hat{\varphi}$
then for every closed loop that goes around the wire we can write $$\oint \vec{B} \cdot d \vec{r}=\int \frac{\mu_{0} I}{2 \pi \rho} \rho d \varphi=\mu_{0} I$$
He mentioned that, the critical point in the proof is that, we can say the magnetic field behaves like $\rho^{-1}$ which is not clear for me why is it so critical. What would happen if it did not behave like that?
In addition he wrote that if the loop that we take does not go along the wire, the circulation of $\vec{B}$ will be equal to zero. This is not clear for me physically or mathematically.
for example loop like that :

while the black dot is the wire in the origin.
 A: Given,
$$\oint \vec{B} \cdot d \vec{r}=\int \frac{\mu_{0} I}{2 \pi \rho} \rho d \varphi=\mu_{0} I$$
There can be 2 reasons your teacher said that the $\rho^{-1}$ is crucial for the proof.

*

*Consider the equation, $\int \frac{\mu_{0} I}{2 \pi \rho^{n}} \rho d \varphi=\mu_{0} I$
where n is a real number. This clearly upon integration yields that current I is directly proportional to $\rho^{1-n}$ which is exactly not the case. It can be relevant if a non uniform current density $J$ is given.

*It is just a take away point, i.e. as one moves far away from the wire the field strength decreases.

For the second part of your question (the diagram).
Use this $$\oint \vec{B} \cdot d \vec{r}=\int \frac{\mu_{0} I}{2 \pi \rho} \rho d \varphi=\mu_{0} I_{enclosed}$$
Here enclosed means the net current flowing in or out of the given loop. Say you have 5 wires and a circular loop around it, if two carry current $i$ along +z axis and 3 carry $2i$ current along - z axis then the net $I_{enclosed}= 2*i - 3*2i= -4i$
Analogously, in this case the loop encloses no current, and hence there will be null value for the circulation of B.
Mathematically, if you consider the previous proof that, if a wire produces the magnetic field $$\frac{\mu_{0} I}{2 \pi \rho}$$ you can take the circulation manually as well. That is,
$$\oint \vec{B} \cdot d \vec{r}=\int\frac{\mu_{0} I}{2 \pi \rho_{1}}*\rho_{1}d\theta+0-\int\frac{\mu_{0} I}{2 \pi \rho_{2}}*\rho_{2}d\theta+0=0$$
Here $\rho_{1},\rho_{2}$ are the radial distances of each part of the circular portion of the wire in the diagram.
A: I don't quite understand what your instructor was telling you, but since the field due to the wire is $\propto 1/\rho$, when integrating along a hypothetical Ampèrean loop around the wire, the factor of $dr = \rho \, d\varphi$ cancels out the $1/\rho$ of the field, leaving the trivial integral $\int_\text{loop} \, d\varphi$ behind, along with some constant factors. As for the reason why $B \propto 1/\rho$, that has to do with the nature of magnetic fields in general (specifically $\nabla \times \textbf{B} = \mu_0 \textbf{J}),$ which allows one to derive Ampère's law in the first place. The law can then be used to obtain the field around simple geometries, such as the long current-carrying wire in your question.
It occurs to me that your instructor might have derived the field due to the wire using something other than Ampère's law and was trying to show that Ampère's law works, using the wire as an example. Indeed, you can derive the same using the phenomenological Biot-Savart law, which while different from Ampère's law, can be shown to be consistent with it. I hope this clarifies your doubts.
