Just very quickly, to clarify:
- A rectangle is any two-dimensional shape with four right-angled corners.
- A square is a rectangle in which all four sides are the same length.
- Therefore all squares are rectangles, but not all rectangles are squares.
I hope that clears things up.
In addition, we can see rectangles as a sub-family of the parallelograms (quadrilaterals with two pairs of parallel sides).
Another sub-family are the lozenges, parallelograms in which the diagonals are perpendicular.
Those examples are a good introduction to categories and sub-categories, some of them overlapping others, partially or totally. A key concept in science.