A closed convex polygon with 3 sides is called a triangle.
A closed convex polygon with 4 sides is called a quadrilateral.
If in a quadrilateral, two pairs of opposite sides are parallel, then it is a parallelogram.
If in a parallelogram, one of the angles is 90°, then it is a rectangle.
If in a parallelogram, all the four sides are equal, then it is called a rhombus.
If in a rhombus, the two diagonals are equal, then it is called a square.
We can frame the sorting rule as follows:
Polygon with 4 equal sides - Square, Rhombus
Polygon with 4 unequal sides - Parallelogram, Rectangle, Kite, Trapezium, Quadrilateral
Polygon with 3 equal sides - Equilateral triangle
Polygon with 3 unequal sides - Skalene triangle
etc.