You can use the guides() function with color/fill as guide_legend() with parameter nrow=2. It will evenly split the legends into two rows.
When you have used the fill parameter of ggplot for the legends, use the following code:
guides(fill=guide_legend(nrow=2, byrow=TRUE))
When you have used the color parameter of ggplot for the legends, use the following code:
guides(color=guide_legend(nrow=2, byrow=TRUE))