We know that we can write the equation in the form
P(x) = a(x-b1) (x-b2) (x-b3)...... where b1,b2,.... are the roots
When we have a multiplicity greater than 1, we take the (x-b) to that power
a is the leading coefficient
p(x) = 1(x-2)^2 (x-0)^2 (x - -4)
Simplifying
P(x) = (x-2)^2 *x^2 * (x+4)
P(x) = x^2 ( x-2)^2 (x+4)