Let $f:X\longrightarrow Y$ be a map between CW-complexes $X$ and $Y$. By the Whitehead Theorems, if one of the conditions:
1- (homotopy version) $\pi_n (f):\pi_n (X)\longrightarrow \pi_n (Y)$ is an isomorphism for all $n\geq 1$,
or
2- (homology version) $\pi_1 (f):\pi_1 (X)\longrightarrow \pi_1 (Y)$ and $H_n (\tilde{f}):H_n (\tilde{X})\longrightarrow H_n (\tilde{Y})$ are isomorphisms for all $n\geq 2$,
hold, then there is a map $g:Y\longrightarrow X$ such that $g\circ f\simeq id_X$ and $f\circ g\simeq id_Y$.
Question: Is there any weaker condition (with respect to above conditions) under which there is a map $g:Y\longrightarrow X$ such that we have only $g\circ f\simeq id_X$?