The 2-layer hydrostatic model is like this
And the pressure of the two layers and the top are and it is easy to find the horizontal gradient of $p_1$ and $p_2$ \begin{equation} \begin{aligned} \nabla p_1 &= \nabla p_H\\ \nabla p_2 &= \nabla p_H + g(\rho_2 - \rho_1)\nabla h_2\\ \end{aligned} \end{equation} Now my problem is that how to get the result \begin{equation} p_2 - p_1 = g(\rho_2 - \rho_1)\eta \end{equation}
from the equations above, where$\eta = h_2 - H_2$. I find this result in the book"Fundamentals of Geophysical Fluid Dynamics" at page 164.
We find \begin{equation} \begin{split} p_2 - p_1 &= \require{cancel} \bcancel{p_H} + \rho_1 g(\require{cancel} \bcancel{H}-h_2) + \rho_2g(h_2 - z) \require{cancel} \bcancel{-p_H} - \rho_1g(\require{cancel} \bcancel{H}-z) \\ &= (\rho_2 - \rho_1)gh_2 - (\rho_2 - \rho_1)gz \\ & = (\rho_2 - \rho_1)g(H_2 + \eta) - (\rho_2 - \rho_1)gz \end{split} \end{equation}
Dividing by $(\rho_2 - \rho_1)g$ yields
\begin{equation} \eta + H_2 - z = \frac{p_2 - p_1}{(\rho_2 - \rho_1)g}. \end{equation} The equation above tells us the distance to the interface at some height $z$ (remember the coordinate origin is at the bottom of the domain). We are interested in the displacement relative to the mean interface height $z = H_2$, so we have \begin{equation} \eta = \frac{p_2 - p_1}{(\rho_2 - \rho_1)g}, \end{equation} which is the result you are looking for. However, in the document they say that they use four more equations to derive the result. Maybe it's a mistake or maybe I'm missing something.
I was a little confused that you said we can find the result in the document - so for anyone wondering:
Using $\phi_n = p_n / \rho_0$ and $g' = g(\rho_2 - \rho_1)/\rho_0$, we find \begin{equation} \eta = \frac{(p_2 - p_1)\rho_0}{(\rho_2 - \rho_1)g\rho_0} = -\frac{\phi_1 - \phi_2}{g'}, \end{equation} which corresponds to what's shown in the document.