As Xander Henderson said, if the question is just 'what is the probability that two people have the same birthday' then individual months is not relevant- though the year, whether a leap year or not, can.
There are 365 days in a non-leap year. Person "A" has some birthday. In order that person "B" has the same birthday, his birthday must be that 1 day out of 365. The probability of that is 1/365.
There are 365 days in a leap year. Person "A" has some birthday. In order that person "B" has the same birthday, his birthday must be that 1 day out of 366. The probability of that is 1/366.
To get the "overall" probability, use the fact that 1/4 of all years are leap years, 3/4 are not*. So the probability two people share the same birthday is (3/4)(1/365)+ (1/4)(1/366).
- Strictly speaking, this is not exactly true. In the Gregorian calendar, Any year divisible by 100 but not divisible by 400, is NOT a leap year. 1800 and 1900, though divisible by 4 were not leap years because they are divisible by 100. The year 2000 was a leap year. It is divisible by 100 but also by 400.