A first order ODE of the form $Mdx+Ndy=0$ is said to be homogeneous if $M(x,y)$ and $N(x,y)$ are homogeneous functions of the same degree (see here). Thus, if $N\neq 0$, it follows that$^{(*)}$
$$
\frac{M(x,y)}{N(x,y)}=f\!\left(\frac{y}{x}\right). \tag{1}
$$
Therefore, multiplying the ODE by $(Mx+Ny)^{-1}$, we obtain
$$
Pdx+Qdy=0, \tag{2}
$$
where
$$
P=\frac{f\!\left(\frac{y}{x}\right)}{xf\!\left(\frac{y}{x}\right)+y}, \qquad Q=\frac{1}{xf\!\left(\frac{y}{x}\right)+y}.
\tag{3}
$$
To prove that $(2)$ is exact,
we have to show that $\frac{\partial P}{\partial y}=\frac{\partial Q}{\partial x}$. Indeed,
$$
\frac{\partial P}{\partial y}
=\frac{\frac{1}{x}f'\!\left(\frac{y}{x}\right)}{xf\!\left(\frac{y}{x}\right)+y}
-\frac{f\!\left(\frac{y}{x}\right)\left(f'\!\left(\frac{y}{x}\right)+1\right)}{\left(xf\!\left(\frac{y}{x}\right)+y\right)^2}
=\frac{\frac{y}{x}f'\!\left(\frac{y}{x}\right)-f\!\left(\frac{y}{x}\right)}{\left(xf\!\left(\frac{y}{x}\right)+y\right)^2} \tag{4}
$$
and
$$
\frac{\partial Q}{\partial x}=-\frac{f\!\left(\frac{y}{x}\right)-\frac{y}{x}f'\!\left(\frac{y}{x}\right)}{\left(xf\!\left(\frac{y}{x}\right)+y\right)^2}
=\frac{\partial P}{\partial y}. \quad{\square}\tag{5}
$$
$^{(*)}$ Proof of $(1)$: Since $M$ and $N$ have the same degree of homogeneity, we have (for $\lambda\neq 0$)
$$
\frac{M(\lambda x, \lambda y)}{N(\lambda x,\lambda y)}=\frac{\lambda^nM(x,y)}{\lambda^nN(x,y)}=\frac{M(x,y)}{N(x,y)}. \tag{P1}
$$
In particular, taking $\lambda=x^{-1}$ in $(\text{P1})$ yields
$$
\frac{M(x,y)}{N(x,y)}=\frac{M(1, x^{-1} y)}{N(1, x^{-1} y)}, \tag{P2}
$$
from which follows $(1)$.