To factor $ x^2+4x-xy-4y $ we can use factoring by grouping.
Group $ \color{blue}{ x^2 }$ with $ \color{blue}{ 4x }$ and $ \color{red}{ -xy }$ with $ \color{red}{ -4y }$ then factor each group.
$$ \begin{aligned} x^2+4x-xy-4y &= ( \color{blue}{ x^2+4x } ) + ( \color{red}{ -xy-4y }) = \\ &= \color{blue}{ x( x+4 )} \color{red}{ -y( x+4 ) } = \\ &= (x-y)(x+4) \end{aligned} $$