It is a reduction problem where dates which are not possible based on arguments will be removed. Albert says he doesn’t know the date nor does Bernard know.
If Albert was told May, then it could be May 15, May 16 or May 19. Here if it was May 19 then Bernard with the number 19 would have been sure it is May 19 as no other month is mentioned with date 19. So it is not May.
If Albert was told June, yet again the possible date could be June 18. As 18 is only appearing in June, Bernard would have been sure it is June 18. So it cannot be June as Albert is sure neither he nor Bernard knows the complete date.
If it were July, yes for both July 14 and July 15, Bernard has other months with dates 14 and 15. So he would not be sure of the date. So July is a possible month.
Again the same argument goes for August. August too is a possible month.
Next, Bernard says I did not know earlier but now I know. So, Albert’s first statement gave him the hint. From the first deduction we have the possible dates as: July 14, July 16, August 14, August 15, August 17.
Bernard too has done this rational deduction and knows that Albert is talking about the above set. If the date were July 14 or August 14, Bernard would be still confused about the Actual month as both July and August have 14. So from Bernard’s statement the possible dates are: July 16, August 15 or August 17.
Now, Albert says he too knows the complete date. So if it was August 15 or August 17, Albert would know it is August but still be wondering if it is 15 or 17. If the date is July 16, then Albert too knows the only possibility is July 16. So, July 16 is the answer