Necessary condition on homology group of a set to be contractible

The first homology group is far from enough to detect contractibility, since spaces can have non-vanishing higher homology groups.

It's not even enough to have $H_n(X;G)$ vanish for every $n$ and $G$. For one thing there are spaces which are weakly contractible (i.e. all their homotopy vanish and hence their homology as well) but which are not contractible, like the Warsaw Circle.

By Whitehead's Theorem a weakly contractible space which is not contractible cannot have the homotopy type of a CW complex, so we can ask if vanishing homology is enough to conclude that a CW complex is contractible. This still is not enough, because we can take the $2$-skeleton $S$ of the Poincare homology $3$-sphere, which is a finite $2$-dimensional CW complex whose homology groups vanish with any coefficients, but $\pi_1(S)$ has order $120$ so it's not contractible.

However there is an affirmative answer to your question that involves the fundamental group. If $X$ is a CW complex such that $\pi_1(X) = 0$ and $H_n(X;\mathbb{Z})=0$ for $n > 1$, then it follows by Whitehead's Theorem and the Hurewicz Theorem that $X$ is contractible.


A counterexample is the sphere $S^2$, whose first homology group will vanish for any coefficients, but which is not contractible (because its second homology group doesn't vanish).