First, where you have "-ln|2- y|= x" you should have "-ln|2- y|= x+ c". Also the exponential of -ln|2- y| is NOT -(2- y)= -2+ y. Rather, -ln|2- y|= ln|(2- y)^{-1}| though I would be inclined to rewrite "-ln|2-y|= x+ c" as "ln|2- y|= -x- c" and then take the exponential: |2- y|= e^{-x- c}.
Now, I am sure that you understand that e^{-x- c}= e^{-x}e^{-c}. And since "c" is just an "undetermined constant" so is e^{-c} so we can call it, say, c'. Also, although e to any power, positive or negative, is always positive, we can remove the absolute value from |2- y| by allowing c' to be negative. That is 2- y= c'e^{-x} where c' can be any number. Then y= 2- c'e^{-x}.