Group with exactly two subgroups of index 2

Such a group does not exist. Suppose the group $G$ has subgroups $N \ne M$ of index two. Clearly they are both normal, and $M N = G$. Then $$ \lvert G : M \cap N \rvert = \lvert G : M \rvert \cdot \lvert M : M \cap N \rvert = \lvert G : M \rvert \cdot \lvert M N : N \rvert = \lvert G : M \rvert \cdot \lvert G : N \rvert = 4. $$ So $G / M \cap N$ is a group of order $4$, which is isomorphic to the Klein four-group $V$, as $a^{2} \in M \cap N$ for each $a \in G$.

Since $V$ has three subgroups of index $2$, $G$ has at least three such subgroups, by the correspondence theorem.