For starters, do you want the probability of
at least two people sharing a birthday, or
exactly two people sharing a birthday. The former is easier, using the formula you gave as a start. However the latter cannot be calculated using your formula, since it omits the possibility of 3 or more people sharing a birthday.
I'll assume it's the former you're interested in. Concentrate on calculating the probability no one has the same birthday. Pretend that there are 365 days in a year for now, and correct this later. Try to figure the chance that there are no shared birthdays, if there are only two people in the room. Then try to do it for three people - and then four. With luck you will see a
pattern emerge. Enjoy...