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