This may be considered sloppy by some, but this is one way to look at it. \(\displaystyle 0^{\infty}\) is not considered an indeterminate form, as opposed to \(\displaystyle {\infty}^{0}\), which is indeterminate.
Because \(\displaystyle \lim_{x\to \infty}0^{x}=0\)
\(\displaystyle \lim_{x\to 0^{+}}x^{\frac{2}{x}}\)
\(\displaystyle =\displaystyle\left(\lim_{x\to 0^{+}} x\right)^\Large{{\left(2 \lim_{x\to 0^{+}}\frac{1}{x}\right)}\)
\(\displaystyle =\left(\lim_{x\to 0^{+}} x\right)^{\infty}=0^{\infty}=0\)
Here's the graph. See why it heads toward 0 if we approach 0 from the right?.