3(x-y)

X(y-3)

I assume you are studying the distributive law. So,

3*(x-y) = 3*x - 3*y
or, 3x-3y

do the other in like wise.