How to cut mesh by curved surface
It's not entirely clear to me exactly what you mean by '"extra" from the roof'. If you mean the overhang on the sides, you could modify the geometry by cutting (in any one of several ways, though in my own workflow a boolean modifier would not be a choice I'd make) the surface of the roof, and removing the vertices outside the new geometry. 

If instead of that, you mean the parts of the rectangles extending above the roof, then you'd probably want to modify the walls. Again, there are several ways to accomplish this, but exactly which one would be most useful is hard to say without seeing more information.