3 component (ternary) system in equilibrium
If there are 3 components, using the formula, F=M+2-P and solving for P under equilibrium conditions there would be a total of 5 phases.


I understand from that you set $F=0$. Equilibrium does not necessarily mean that you have no degrees of freedom. In this case, you actually have two degrees of freedom: the molar fractions of two components, for example $X(\rm{Cl}_2)$ and $X(\rm{I}_2)$.

$X(\rm{F}_2) = 1 - X(\rm{Cl}_2) -X(\rm{I}_2)$ and cannot vary independently, so it is not a degree of freedom. Once you consider $F=2$, you only need three phases.

What about liquids and solid? Let's say that you vary temperature, and you reach the melting/condensation/etc curve in $T$ space. On the curve itself you will have four phases, three gases and (for instance) liquid chlorine. This causes you to lose a degree of freedom, which in this case is temperature. These four phases can exist only in that specific temperature.

EDIT

Following the comments on the original question, I would like to note that I was addressing a simplified case where the only phases possible are the ones listed in the original question. Once you have intermediate compounds (ICl for example) it's a whole different story.