The rectangle is a trend continuation pattern and consists of a price formation in which demand and supply are apparently balanced for a certain period of time. The price moves in a narrow range where it finds a support at the bottom of the rectangle and a resistance at the top of the figure.
Finally, the price ends up breaking out the rectangle range, either through support or resistance. If the previous trend was bullish, then the breakout is most likely to be bullish, but if the previous trend was bearish, the move will most likely be bearish.
However, the rectangle can also be a reversal trend pattern, for example if the previous trend was bullish and the pattern breakout occurs on the downside or when the previous trend was bearish and the price breaks through resistance.