One way to think about how to distinguish, if not classify, such spaces is by homotopy operations. In the same way that cohomology operations are natural transformations between cohomology functors, homotopy operations are natural transformations between homotopy functors. By the Yoneda lemma, natural transformations $\pi_n \to \pi_m$ are in natural bijection with the homotopy group $\pi_m(S^n)$, so elements of the homotopy groups of spheres give unary operations on homotopy.
More generally, the $k$-ary operations on homotopy groups are natural transformations $\pi_{n_1} \times \dots \times \pi_{n_k} \to \pi_m$, and by the Yoneda lemma these are in natural bijection with the homotopy group $\pi_m(S^{n_1} \vee \dots \vee S^{n_k})$. For example, the Whitehead bracket $\pi_n \times \pi_m \to \pi_{n+m-1}$ is a well-known family of binary operations coming from some distinguished homotopy classes of maps $S^{n+m-1} \to S^n \vee S^m$. They make the homotopy groups of a space into a graded Lie algebra (up to a degree shift).
A product of Eilenberg-MacLane spaces always has trivial homotopy operations, so you can distinguish a space from a product of Eilenberg-MacLane spaces by checking to see whether any of its homotopy operations are trivial. For example, the homotopy operation $\pi_2(S^2) \to \pi_3(S^2)$ given by a generator of $\pi_3(S^2) \cong \mathbb{Z}$ must be nontrivial since it is the universal example; this shows that the $3$-truncation of $S^2$ is a homotopy type with $\pi_2 \cong \pi_3 \cong \mathbb{Z}$ and all other homotopy groups trivial but which cannot be homotopy equivalent to $B^2 \mathbb{Z} \times B^3 \mathbb{Z}$.
Moreover, it's a classical result that $H^4(B^2 A, B)$, the cohomology group that classifies the $k$-invariant of a space with $\pi_2 \cong A, \pi_3 \cong B$, can be identified with the group of quadratic functions $A \to B$. Given such a $k$-invariant, the corresponding quadratic function turns out to be precisely the homotopy operation $\pi_2 \to \pi_3$. So in this case the classification by $k$-invariants and by homotopy operations agree.