From the grouping above, the denominator is (x−2)(x−1)(x+1), so the excluded values are x=2, x=1 and x=−1. The numerator is (x−1)(x+1).
(x−2)(x−1)(x+1)(x−1)(x+1)=x−21(x=2,x=1,x=−1)
Both cancelled factors take their restrictions out of sight. The form x−21 is perfectly well defined at x=1 and x=−1, but the original is not, so all three restrictions belong in the answer.
Check at x=0: the original is 2−1=−21, and 0−21=−21 agrees.