To factor $ 10q^2+2qr+5q+r $ we can use factoring by grouping.
Group $ \color{blue}{ 10q^2 }$ with $ \color{blue}{ 2qr }$ and $ \color{red}{ 5q }$ with $ \color{red}{ r }$ then factor each group.
$$ \begin{aligned} 10q^2+2qr+5q+r &= ( \color{blue}{ 10q^2+2qr } ) + ( \color{red}{ 5q+r }) = \\ &= \color{blue}{ 2q( 5q+r )} + \color{red}{ 1( 5q+r ) } = \\ &= (2q+1)(5q+r) \end{aligned} $$