First, we draw a picture. (My chances of getting the right answer without a picture are not good.)
We are integrating over the part of the rectangle which is below the line $y=x$. This is a triangle.
Myself, out of habit, I would prefer integrating first with respect to $y$, unless there is good reason not to do so. Then everything is simpler, since $y$ is going from $0$ to $x$. The fact that we begin at $y=0$ simplifies the result of the first integration, and one is much less likely to make a mistake.
But if you really wish to integrate first with respect to $x$, note that the biggest that $y$ ever gets in our triangle is $y=1$. So if you change the $\int_0^2$ to $\int_0^1$, things should turn out OK.