You want to integrate over the triangle bounded by the line x = y, x = 2 and
the axis, y = 0.
This can be written as the integral first over y from 0 to x, and then from
x from 0 to 2. If we want to integrate first over x, then we must integrate
from y to 2 over x and from 0 to 2 over y.
Many beginners fall into the trap of using the same limits after reversing the
order of integration. This is an error.
The region 0 < y < x, 0 < x < 2 is very different from the region
0 < x < y, 0 < y < 2. Obviously in the former y is always less than
x and in the latter y is always bigger than x. Do not make this mistake.