Can you help with the following equation?

x-2
x-2
------
x(2)-2x
-2x+4
----------
x(2)-4x+4

That is not an equation. It is a multiplication. It is correct as you wrote it, although usually written differently.

Here is one common way:
(x-2)(x-2) = x(x-2) -2(x-2)
= x^2 - 2x - 2x + 4
= x^2 -4 x + 4