This follows from the argument principle. We integrate over the $D$ shaped curve which starts from the positive imaginary axis say $iA$, down the imaginary axis to $-iA$ and then by a semicircle back to $iA$. We let $A\to \infty$. The difficult part is to find the image of this curve under the function $$f(x)=x^5+5x^3+2x^2+4x+1.$$ And in particular the number of times this image goes around the origin will be the number of roots. The semicircle part of the curve crosses the positive real axis $3$ times in the counterclockwise direction. For the segment along the imaginary axis we find
$$f(iy)=(y^5-5y^3+4y)i-2y^2+1$$
Thus this crosses the real axis only when $y=-2,-1,0,+1,+2$ and we see also that it only crosses the positive real axis at $y=0$. By looking at the graph of the imaginary part we see that at $y=0$ it is going in the clockwise direction so the total number of roots is
$$3-1=2$$ Which coincides with the answer of Robert above (thanks, Robert.)