Non-homotopic spaces with the same homology groups

I'm currently studying algebraic topology. I'm interested in some examples of topological spaces $$X$$, $$Y$$ that have the same homology groups $$H_n(X)$$, but different homotopy groups $$\pi_n(X)$$.

Furthermore, what about spaces which have the same homotopy groups, but are not homeomorphic? I'm trying to make sense of this and I think some examples would be helpful.

Any insights would be appreciated.

That's a great question ! And in the beginning, examples aren't easy to find.

For the first one, there are things such as (Poincaré) homology spheres : those are spaces which have the homology of a sphere, but a nontrivial $$\pi_1$$. Depending on what you already know, this may or may not be easy to construct, so here's a more elementary example : take $$\mathbb T = S^1 \times S^1$$ on one side and $$S^1\vee S^1 \vee S^2$$ on the other side. It's easy to see that their homologies are the same, but their $$\pi_1$$ and $$\pi_2$$ (and actually many others) differ.

A way to understand why examples are not too easy to find : any map between simply-connected spaces which induces an isomorphism on $$H_*$$ also induces one on $$\pi_*$$. Watch out : this is not saying that simply-connected spaces with the same $$H_*$$ have the same $$\pi_1$$ : there really has to be a map. Can you tweak my example to see why that is ?

As for spaces with the same $$\pi_*$$ but not homeomorphic , this is easy : just take any non-singleton contractible space (such as $$\mathbb R$$) and more generally homotopy-equivalent spaces that aren't homeomorphic. So maybe you meant "same $$\pi_*$$ but not homotopy equivalent" Depending on what you know, this can also be tricky, for two reasons : the first is that again any map (between nice spaces) inducing an isomorphism on $$\pi_*$$ is a homotopy equivalence (note that once again we require a map !). The second reason is that, without a map, any two (nice) spaces with exactly one nonzero homotopy group, which are isomorphic, (say $$\pi_n(X) \cong \pi_n(Y)$$ for all $$n$$, and all of them are zero except for one $$k$$) are homotopy equivalent (those are called Eilenberg-MacLane spaces).

So with that in mind, it can be hard to find examples. If you know about the long exact sequence of a fibration, then here's one example : $$S^3\times \mathbb CP^\infty$$ and $$S^2$$ have isomorphic homotopy groups, but are not homotopy equivalent

(To see it, use the long exact sequence of the Hopf fibration $$S^1\to S^3\to S^2$$)

I don't know a simpler example, however, so it really depends on what you know.