Let $D_1 = 1$ be the event that the first loan defaults and let $D_2 = 1$ be the event that the second loan defaults. Assume that we know the correlation $\rho$ between $D_1$ and $D_2$ and we know the marginals $p_1$ and $p_2$.
The aim is to compute the probability that one of the two loans defaults (for the junior tranche) and the probability that both default (senior tranche).
First, notice that:
$$
\begin{align*}
&\mathbb{E}[D_1] = \Pr(D_1) = p_1\\
&\mathbb{E}[D_2] = \Pr(D_2) = p_2.
\end{align*}
$$
First, let us try to compute the probability that both loans default.
$$
p_{12} = \Pr(D_1 = 1 \text{ and } D_2 = 1)
$$
The covariance between $D_1$ and $D_2$ is given by:
$$
cov(D_1, D_2) = \mathbb{E}\left[(D_1 - p_1)(D_2 - p_2)\right] = p_{12} - p_1 p_2
$$
Next, the variance of $D_1$ and $D_2$ equals:
$$
\begin{align*}
var(D_1) &= \mathbb{E}\left[(D_1 - p_1)^2\right] = p_1 - (p_1)^2 = p_1(1-p_1),\\
var(D_2) &= p_2(1- p_2).
\end{align*}
$$
So the correlation is given by:
$$
corr(D_1, D_2) = \rho = \frac{cov(D_1, D_2)}{var(D_1)} = \frac{p_{12} - p_1 p_2}{\sqrt{p_1(1-p_1)} \sqrt{p_2(1-p_2)}}
$$
As such, the probability that both default is given by:
$$
p_{12} = \rho \sqrt{p_1(1-p_1)} \sqrt{p_2(1-p_2)} + p_1 p_2.
$$
Then also:
$$
\begin{align*}
\Pr(D_1= 1 \text{ and } D_2 = 0) &= \Pr(D_1 = 1)- \Pr(D_1 = 1 \text{ and } D_2 = 1),\\
&= p_1 - \rho \sqrt{p_1 p_2(1-p_1)(1-p_2)} - p_1 p_2\\
\Pr(D_2 = 1 \text{ and } D_2 = 0) &= p_2 - \rho \sqrt{p_1 p_2(1-p_1)(1-p_2)} - p_1 p_2
\end{align*}
$$
Then the probability that at least one defaults is given by:
$$
\begin{align*}
\Pr(D_1 = 1 \text{ or } D_2 = 1) &= \Pr(D_1 = 1 \text{ and } D_2 = 0) + \Pr(D_1 = 0 \text{ and } D_2 = 1) + \Pr(D_1 = 1 \text{ and } D_2 = 1),\\
&= p_1 + p_2 - \rho\sqrt{p_1 p_2(1-p_1) (1-p_2)} - p_1 p_2,\\
\end{align*}
$$