Why this two spaces do not homeomorphic?

It is a theorem of Sierpinski that every countable metric space without isolated points is homeomorphic to $\mathbb{Q}$. See eg here. $\mathbb{Q}^2$ is a countable metric space without isolated points. Therefore these two spaces are homeomorphic.