Your logic can only cover part of the solutions, but may not find out all of them.
If you are seeking real solutions only,
Take logarithm at both side
$$x^2=2^x$$
$$2\ln x=x\ln 2$$
$$\frac{\ln x}x=\frac{\ln2}2$$
Now consider the function
$$f(x)=\frac{\ln x}x$$
$$f'(x)=\frac{1-\ln x}{x^2}$$
$f(x)$ is increasing in $(0,e)$ and decreasing in $(e,\infty)$.
Thus $f(x)=\frac{\ln2}2$ has exactly one solution at each of the region $(0,e)$ and $(e,\infty)$.
With observation we know the only positive real solutions are $x=2$ and $x=4$.
Edit:
As the comment and other answers suggested, there is also a negative solution given in terms of
the Lambert W function, which is defined as the inverse function of $f(z)=ze^z$.
We may use the identity
$$z=W(z)e^{W(z)}$$
Using this approach by @Aaron Maroja
$$ x=-\frac2{\ln2}W(\frac{\ln2} 2)\approx-0.766$$