2 added 373 characters in body

A slight expansion on my comment, sort of complimentary to Tom's response.

In complete generatlity $H_2X$ tells you nothing about $\pi_1 X$.

If $X = A \times B$ with $A$ a $K(\pi,1)$ and $B$ a $K(\pi,2)$, provided $H_2(A)=0$, you have that $H_2 X = H_2 B$.

Since there are lots of $K(\pi,1)$ spaces with $H_2$ trivial, this allows you to construct many spaces with identical fundamental groups yet $H_2$ varies wildly.

You'll want to restrict to fairly particular spaces to avoid this independence.

edit: If you're happy taking covering spaces then $H_2$ (of of an arbitrary cover of $X$) starts to see quite a bit more of $\pi_1 X$. If $\widetilde{X} \to X$ is the universal cover then $H_2 \widetilde{X} \simeq \pi_2 X$ by the Hurewicz theorem. So now Tom's comments apply, giving you a concrete relationship between $H_2 X$, $\pi_1 X$ and $\pi_2 X = H_2 \widetilde{X}$.

1

A slight expansion on my comment, sort of complimentary to Tom's response.

In complete generatlity $H_2X$ tells you nothing about $\pi_1 X$.

If $X = A \times B$ with $A$ a $K(\pi,1)$ and $B$ a $K(\pi,2)$, provided $H_2(A)=0$, you have that $H_2 X = H_2 B$.

Since there are lots of $K(\pi,1)$ spaces with $H_2$ trivial, this allows you to construct many spaces with identical fundamental groups yet $H_2$ varies wildly.

You'll want to restrict to fairly particular spaces to avoid this independence.