A compact infinite topological group with only two closed subgroups

I suppose that the group is Hasdorff: otherwise consider the factor group with respect to the closure of $\{ 1\}$. Closed subgroups of the quotient will correspond to closed subgroups of the initial group.

Let $G$ be a non-abelian Hausdorff topological group. Then for all $g \in G$ $$C_G(g) = \{ x \in G : xg=gx\}$$ is a closed subgroup of $G$.

In particular, since $G$ is not abelian, there exist $g,h \in G$ such that $gh \neq hg$. So, $C_G(g)$ and $C_G(h)$ are two distinct closed non-trivial proper subgroups of $G$ (since $g \in C_G(g) \setminus C_G(h)$ and $h \in C_G(h) \setminus C_G(g)$).

So, it seems that $G$ has at least 4 closed subgroups.