The substitution works because you get
$$
x=2\arctan u
$$
so
$$
dx=\frac{2}{1+u^2}\,du
$$
Since
$$
2\sin x-3\cos x=2\frac{2u}{1+u^2}-3\frac{1-u^2}{1+u^2}=
\frac{3u^2- 4u -3}{1+u^2}
$$
the integral becomes
$$
\int\frac{1+u^2}{3u^2- 4u -3}\frac{2}{1+u^2}\,du=
2\int\frac{1}{3u^2-4u -3}\,du
$$
that's solvable by partial fractions.
A different way is to write
$$
2\sin x-3\cos x=A\sin(x-\varphi)
$$
that becomes
$$
2\sin x-3\cos x=A\sin x\cos\varphi-A\cos x\sin\varphi
$$
so we can set
$$
A\cos\varphi=2,\quad A\sin\varphi=3
$$
and so $A^2=13$. There is a unique angle $\varphi\in[0,2\pi)$ such that
$$
\sin\varphi=\frac{3}{\sqrt{13}},\quad
\cos\varphi=\frac{2}{\sqrt{13}}
$$
Now the integral becomes
$$
\sqrt{13}\int\frac{1}{\sin(x-\varphi)}\,dx
$$
and we can do the substitution $x-\varphi=2u$, so $dx=2\,du$ and the integral is
\begin{align}
\sqrt{13}\int\frac{1}{\sin u\cos u}\,du
&=\sqrt{13}\int\frac{\sin^2u+\cos^2u}{\sin u\cos u}\,du\\
&=\sqrt{13}\left(\int\frac{\sin u}{\cos u}\,du
+\int\frac{\cos u}{\sin u}\,du\right)\\
&=\sqrt{13}(\log|\cos u|-\log|\sin u|)+c
\end{align}
and it's just tedious to do the back substitution.