Use Conditional Formatting, Use a formula to determine... and enter the formula
=DATE(YEAR($D2),MONTH($D2),1)>DATE(YEAR(B$1),MONTH(B$1),1)
(or the shorter =EOMONTH(B$1,0)<EOMONTH($D2,0)
as suggested by pnuts),
and Applies to
=$B$2:$C$4
The formula gets rid of the day in each of the two cells to be compared, keeping only the months/years. It also uses suitable relative/absolute indexing for the matrix. I have used both, each with different formatting, to test them at once.