To factor $ pq+pr+8q+8r $ we can use factoring by grouping.
Group $ \color{blue}{ pq }$ with $ \color{blue}{ pr }$ and $ \color{red}{ 8q }$ with $ \color{red}{ 8r }$ then factor each group.
$$ \begin{aligned} pq+pr+8q+8r &= ( \color{blue}{ pq+pr } ) + ( \color{red}{ 8q+8r }) = \\ &= \color{blue}{ p( q+r )} + \color{red}{ 8( q+r ) } = \\ &= (p+8)(q+r) \end{aligned} $$