You could do it a few different ways, but I would cut the rectangles, switch to Draw Inside mode, and paste in place.
That would be whatever shape you pasted the rectangles into. It doesn't have to be one of your visible shapes--it could be a shape with a fill/stroke of None.
Let me know if this makes any sense--it IS Friday...
There are so many ways to do this. I suggest you learn all of these, in this order.
Clipping Masks - https://helpx.adobe.com/illustrator/using/clipping-masks.html