How is a rectangle represented? Three points? Four points? Point, side and angle? Two points and a side? Something other? Without knowing this, any attempt to answer your question will have purely academic significance.
In any case, for any convex polygon (including a rectangle) the test is very simple: check each edge of the polygon, assuming that each edge is oriented counterclockwise, and check whether the point is to the left of the edge (to the left is the airplane half-plane). If all edges pass the test, the point is inside. If at least one failure - the point is outside.
To check if the point (xp, yp) lies on the left side of the edge (x1, y1) - (x2, y2) , you just need to calculate
D = (x2 - x1) * (yp - y1) - (xp - x1) * (y2 - y1)
If D > 0 , the point is on the left side. If D < 0 , the point is on the right side. If D = 0 , the point is on a straight line.
A previous version of this answer described a seemingly different version of the left test (see below). But it is easy to show that it calculates the same value.
... To check if the point (xp, yp) lies on the left side of the edge (x1, y1) - (x2, y2) , you need to build an equation for the line containing the edge. The equation looks as follows
A * x + B * y + C = 0
Where
A = -(y2 - y1) B = x2 - x1 C = -(A * x1 + B * y1)
Now all you have to do is calculate
D = A * xp + B * yp + C
If D > 0 , the point is on the left side. If D < 0 , the point is on the right side. If D = 0 , the point is on a straight line.
However, this test, again, works for any convex polygon, which means that it may be too general for a rectangle. A rectangle may allow a simpler test ... For example, in a rectangle (or in any other parallelogram), the values of A and B have the same value, but different signs for opposite (i.e. parallel) edges, which can be used to simplify the test.