They give us the length of side of the square which is 3-7x.
To get an expression for the perimeter that is expressed as a product we have to multiply the expression 3-7x by four since every square has four sides. This will give us an expression of 4(3-7x). We than can use the distributive property to multiply everything inside the parenthesis by 4. This will give us an expression of 12-28x.