The domain is the set of all point where you can evaluate the function.
As you can see, the first piece is defined from -infinity to 2 (included).
The second piece is defined from 2 to 6 (excluded).
The third piece is defined from 6 (excluded) to +infinity.
So, the domain of the function is composed by all the real numbers which are not 6:

As for the range, it is the set of all values taken by the function. We can see that the first piece spans the y axis from 0 to infinity.
The second piece is constantly equal to 2, so it adds nothing.
The third piece spans the y axis from -2 to -infinity, so the range is
