5 squares have more sides.
If you have 5 squares, a square has 4 sides each. Here, each means to multiply. 5 x 4 = 20, so 5 squares have 20 sides in total.
If you have 6 triangles, a triangle has 3 sides each. 6 x 3 = 18, so 6 triangles have 18 sides in total.
Now compare these two. 20 > 18, so 5 squares have more sides than 6 triangles.