I think I've got it. The transformation $T$ must take the boundary of the upper half-plane to the boundary of the right half-plane. That is, it must take the real axis to the imaginary axis. If $$T(z)={az+b\over cz +d},\ ad-bc\neq=0,\tag{1}$$ we have that $x\in\mathbf{R}$ implies $$\Re\frac{(ax+b)\overline{(cx+d)}}{|cx+d|^2}=0\implies\Re(ax+b)\overline{(cx+d)}=0$$
Now for given, $a,b,c,d\in\mathbf{C},\ \Re(ax+b)\overline{(cx+d)}$ is a quadratic in $x$ that vanishes everywhere, so all the coefficients must be $0$. That is,
$$\Re(a\overline{c})=\Re(a\overline{d}+b\overline{c})=\Re(b\overline{d})=0\tag{2}$$
Let us assume that $c\neq0.$ Then we may divide numerator and denominator in $(1)$ by $c$, or what is the same thing, we may assume that $c=1,$ so $(2)$ becomes
$$\Re(a)=\Re(a\overline{d}+b)=\Re(b\overline{d})=0\tag{3}$$
From $c=1$ we have $T(-d)=\infty,$ but $\infty$ is on the imaginary axis so $d\in\mathbf{R},$ and from $(3),$ we have $\Re a=0$ and $\Re(ad+b)=0,$ so that $\Re b = 0.$ That is,
$$T(z) = i\frac{\alpha z+\beta}{z+d}, \text { where } \alpha,\beta,d\in\mathbf{R}, \alpha d -\beta\neq0$$
which can obviously be re-written more symmetrically as
$$T(z) = i\frac{\alpha z+\beta}{\gamma z+ \delta}, \text { where } \alpha,\beta,\gamma \delta\in\mathbf{R}, \alpha\delta-\beta\gamma\neq=0$$
However, this leaves open the possibility that $T$ maps the upper half-plane to the $left$ half-plane.
This leaves you with two things to do. First, finish off the $c\neq0$ case. (Hint: $\Re T(i)>0$.) Second, do the (easier) $c=0$ case.
I feel that there must be an easier way of seeing this, but I've not been able to find one.