You should have
y = a*(x-p)*(x-q)
2 = a*(x-0)*(x-1)
2 = a*(2-0)*(2-1)
2 = a*(2)*(1)
2 = 2a
2a = 2
2a/2 = 2/2
a = 1
So the equation
y = a(x-0)(x-1)
updates to
y = 1(x-0)(x-1)
and that simplifies to
y = x(x-1)
The next step is to distribute the x through to get this final answer
y = x^2-x