The answer depends on their relative dimensions.
2 squares and 4 rectangles * * * * * 6 rectagles in three pairs. The ends need not be squares.
2
6
You need 4 rectangles and two squares * * * * * No, you do not need to have squares: there can be six rectangles - as in a brick shape.
A larger rectangular prism.
A rectangular prism has 6 flat surfaces
A rectangular prism.
6 rectangles. Three pairs of two each. A box is a rectangular prism.
6
Two are needed at each end of the prism
j