On the first line the distributive property was used. This property says that the product of a constant with a sum of two numbers is equal to the sum of the products.
On the third line the "associative" property was used. This property says that if you have the sum of three numbers the order at which you sum them doesn't affect the results.