Love the curiosity!
To solve this requires more than regular algebra. It requires use of the Lambert W function.$$f(x)=xe^x$$$$W(x)=f^{-1}(x)$$The solution, is, of course, not solvable. But it does allow us to do some amazing things.
First, let's attempt to solve for $W(x)$ to find its identities.$$x=ye^y$$$$y=W(x)$$Upon using substitutions, we get two identities.$$(1)y=W(ye^y)$$$$(2)x=W(x)e^{W(x)}\to\frac x{W(x)}=e^{W(x)}$$
Now, lets try to solve.$$2^x=x^2$$First, note that we must have base $e$.$$e^{\ln(2)x}=x^2\to\frac{e^{\ln(2)x}}{x^2}=1\to x^{-2}e^{\ln(2)x}=1$$Now the whole point is to get the base and exponent to be the same so that we can use the first identity(1).$$[x^{-2}e^{\ln(2)x}]^{-\frac12}=[1]^{-\frac12}$$$$xe^{-\frac12\ln(2)x}=1\to-\frac12\ln(2)xe^{-\frac12\ln(2)x}=-\frac12\ln(2)$$
Now we take the "$W$" of both sides to produce the first identity(1).$$W(-\frac12\ln(2)xe^{-\frac12\ln(2)x})=W(-\frac12\ln(2))$$$$-\frac12\ln(2)x=W(-\frac12\ln(2))$$
Now divide.$$x=\frac{W(-\frac12\ln(2))}{-\frac12\ln(2)}$$
Use a calculator to find all values.
Also, this allows an infinite number of complex answers.