$H_2(X)$ is all about $\pi_1(X)$ and $\pi_2(X)$. If $\pi_2(X)$ is trivial (as for knot complements) then it is a functor of $\pi_1(X)$.
Let $H_n(G)$ be $H_n(BG)$, the homology of the classifying space ($K(G,1)$). If $X$ is path-connected than there is a surjection $H_2(X)\to H_2(\pi_1(X))$ whose kernel is a quotient of $\pi_2(X)$, the cokernel of a map from $H_3(\pi_1(X))$ to the largest quotient of $\pi_2(X)$ on which the canonical action of $\pi_1(X)$ becomes trivial.
This $H_2(G)$ isn't anything like the next piece of the derived series after $H_1(G)=G^{ab}$, though. For example, if $G$ is abelian then $H_2(G)$ is the second exterior power of $H_1(G)$, H_1(G)$(EDIT: so it can be nontrivial even though it knows no more than$H_1(G)$does), while if$H_1(G)$is trivial$H_2(G)$is often nontrivial (EDIT: so, even when it does carry some more information than$H_1(G)$, it is not necessarily derived-series information). The place to look for the rest of the derived series would be homology with nontrivial coefficients, for example homology of covering spaces. 2 corrected an error about the$\pi_2$contribution; added 1 characters in body$H_2(X)$is all about$\pi_1(X)$and$\pi_2(X)$. If$\pi_2(X)$is trivial (as for knot complements) then it is a functor of$\pi_1(X)$. Let$H_n(G)$be$H_n(BG)$, the homology of the classifying space ($K(G,1)$). If$X$is path-connected than there is a surjection$H_2(X)\to H_2(\pi_1(X))$whose kernel is a quotient of$\pi_2(X)$, the cokernel of a map from$H_3(\pi_1(X))$to the largest quotient of$\pi_2(X)$on which the canonical action of$\pi_1(X)$becomes trivial. This$H_2(G)$isn't anything like the next piece of the derived series after$H_1(G)=G^{ab}$, though. For example, if$G$is abelian then$H_2(G)$is the second exterior power of$H_1(G)$, while if$H_1(G)$is trivial$H_2(G)$is often nontrivial. The place to look for the rest of the derived series would be homology with nontrivial coefficients, for example homology of covering spaces. 1$H_2(X)$is all about$\pi_1(X)$and$\pi_2(X)$. If$\pi_2(X)$is trivial (as for knot complements) then it is a functor of$\pi_1(X)$. Let$H_n(G)$be$H_n(BG)$, the homology of the classifying space ($K(G,1)$). If$X$is path-connected than there is a surjection$H_2(X)\to H_2(\pi_1(X))$whose kernel is a quotient of$\pi_2(X)$, the largest quotient on which the canonical action of$\pi_1(X)$becomes trivial. This$H_2(G)$isn't anything like the next piece of the derived series after$H_1(G)=G^{ab}$, though. For example, if$G$is abelian then$H_2(G)$is the second exterior power of$H_1(G)$, while if$H_1(G)$is trivial$H_2(G)\$ is often nontrivial.