It is just applying the distributive law repeatedly ($a(b+c) = ab + ac$), adding the exponents of terms with a common base (e.g., $(x)(2x)$ becomes $2x^2$), and collecting terms with the same bases and exponents (e.g., $(-7xy) + (2xy)$ becomes $-5xy$). You keep on doing this until nothing else can be done.
In your case, as Robert Israel stated, the distributive law applied twice gives $(x)(2x)+(x)(−7xy)+(y)(2x)+(y)(−7xy)$. Adding the exponents of parts of terms with common bases gives
$(2x^2)-(7x^2y)+(2xy)-(7xy^2)$. There are no terms with the sames bases and exponents, so you can remove the parentheses and you are done.