The if node is comparing two vectors - the world space position of the pixel, and another vector defining which direction and distance you’re defining as a boundary. In the example I built, we’re working in +X, so there is a vector created with 500,0,0 (the constant with the 0,0 vector appended) which is basically telling the if node to check whether or not the pixels exist beyond x=500.
To do the same in Y and Z, you need to create vectors 0,x,0 and 0,0,x, where x is the distance at which you’re placing your invisible boundary.
Does that make sense?