No, the corner of the rectangle does not have to be in another rectangle to collide the rectangles. What you want to do is find the logic when they don't intersect, and use the negation of it. The figure below shows two rectangles that clearly intersect each other, but only the sides intersect, not the corners.

Just formulate the logic as follows: what is needed so that blue does not intersect red? Well, it's either completely right, completely left, up or down. Formulate an if statement and cancel it. Let me help you from the start:
if (!(x2 > x+oWidth || x2+o2Width < x || ..)) collide = true;
source share