Could someone show an example of two spaces $X$ and $Y$ which are not of the same homotopy type, but nevertheless $\pi_q(X)=\pi_q(Y)$ for every $q$? Is there an example in the CW complex or smooth category?
There are such spaces, for example $X = S^2 \times \mathbb{R}P^3$, $Y = S^3 \times \mathbb{R}P^2.$
(These are both smooth and CW-complexes.)

Whitehead's Theorem says that for CW-complexes, if a map $f : X \to Y$ induces an isomorphism on all homotopy groups then it is a homotopy equivalence.  But, as the example above shows,
you need the map.  Such a map is called a weak homotopy equivalence.

(Whitehead's Theorem is not true for spaces wilder than CW-complexes.  The Warsaw circle
has all of its homotopy groups trivial but the unique map to a point is not a homotopy equivalence.)
