Let $G=Gal(E/F)$, $H_i=Gal(E/M_i)\le G, i=1,2.$
If $G=H_1\times H_2$ then $H_1\unlhd G$, $H_2\unlhd G$. This implies that both $M_1/F$ and $M_2/F$ must be Galois extensions.
From $G=H_1\times H_2$ it also follows that $H_1\cap H_2=\{1_G\}$. By Galois correspondence this is equivalent to the requirement $M_1M_2=E$ (you also listed the fact $H_1\cap H_2=Gal(E/M_1M_2)$.
You observed already that $M_1\cap M_2 =F$ is necessary for $H_1$ and $H_2$ to generate all of $G$.
These three necessary requirements are also sufficient:
- If $H_1$ and $H_2$ are both normal subgroups of $G$, then $(H_1,H_2)=H_1H_2$ (for this to hold it suffices that one of them is normal).
- If $(H_1,H_2)=G$ then by the previous bullet $G=H_1H_2$.
- If $H_1\cap H_2$ is trivial, then they must commute with each other. By normality any commutator
$$
\begin{aligned}
\lbrack h_1,h_2\rbrack&=h_1h_2h_1^{-1}h_2^{-1}\\
&=(h_1h_2h_1^{-1})h_2^{-1}\\
&=h_1(h_2h_1^{-1}h_2^{-1}
\end{aligned}
$$
is an element of both $H_1$ and $H_2$, and
hence equal to the neutral element. Therefore the product $H_1H_2$ is direct.
Summary: $Gal(E/F)=Gal(E/M_1)\times Gal(E/M_2)$ if and only if A) $M_1\cap M_2=F$, B) $M_1M_2=E$ and C) both $M_1$ and $M_2$ are Galois over $F$.
When all this holds, we can also conclude that $H_1\simeq Gal(M_2/F)$ and
$H_2\simeq Gal(M_1/F)$. This is because the basic results of Galois theory also state that $Gal(M_i/F)\simeq G/H_i$.