The maximum number of pencils that he must select in order to ensure that he selects at least 2 pencils of each color is:
26
Since, Ben has 30 pencils in a box.
Each of the pencils is one of 5 different colors, and there are 6 pencils of each color.
This means that if he draw 24 pencils then there may be a worst case that all these pencils must be of 4 of the 5 colors and none of the pencil of the 5th color is drawn.
This means that in order to confirm that he has at least 2 pencils of each color he need to draw 2 more pencils.
This means that he need to draw: 24+2=26 pencils.