This problem corresponds to the problem of non negative integral solutions to the equation
$P1+P2+P3= 2n+1$ where we have to distribute $2n+1$ seats(identical) among 3 parties(distinct) $P1,P2,P3$.
The solution will be ${}^{n-1+r}C_r$ having $n=3$ and $r=2n+1$. This comes as ${}^{ 2n+3}C_{2n+1}$ which further reduces to ${}^{2n+3}C_2=A$. (say).
EDIT :
The constraint the the coalition of 2 parties must form a govt can be dealt with as follows-
We have to also ensure that govt must be formed by coalition so we have to eliminate the case where a single party gets a majority i.e. $n+1$ votes. That corresponds to non negative integral solutions to the eqn
$P1+P2+P3=n$
solution will be ${}^3C_1 \times {}^{n+2}C_n$ which reduces to $3 \times {}^{n+2}C_2=B.$
Hence the final answer will be $A-B$ i.e., ${}^{ 2n+3}C_2 - 3 \times {}^{n+2}C_2.$