The probability at least two of $n$ people share a birthday (with each birthday iid uniformly likely from a year of of $d$ days, and $n \le d$) is $$1- \frac{d!}{(d-n)!d^n}$$
The probability exactly two of $n$ people share a birthday is $$\frac{n(n-1)}{2}\frac{d!}{(d-n+1)!d^n}$$
With $d=365$ you get the following probabilities. Note that the probability of exactly two sharing a birthday starts falling when $n>28$ as the probability of another pair sharing a different birthday or of three or more sharing the same day increases
n Prob >=2 Prob =2
0 0.000000000 0.000000000
1 0.000000000 0.000000000
2 0.002739726 0.002739726
3 0.008204166 0.008196660
4 0.016355912 0.016303493
5 0.027135574 0.026949153
6 0.040462484 0.039980730
7 0.056235703 0.055206268
8 0.074335292 0.072398357
9 0.094623834 0.091298437
10 0.116948178 0.111621719
11 0.141141378 0.133062603
12 0.167024789 0.155300463
13 0.194410275 0.178005662
14 0.223102512 0.200845657
15 0.252901320 0.223491058
16 0.283604005 0.245621484
17 0.315007665 0.266931110
18 0.346911418 0.287133773
19 0.379118526 0.305967528
20 0.411438384 0.323198575
21 0.443688335 0.338624492
22 0.475695308 0.352076697
23 0.507297234 0.363422157
24 0.538344258 0.372564283
25 0.568699704 0.379443076
26 0.598240820 0.384034510
27 0.626859282 0.386349239
28 0.654461472 0.386430661
29 0.680968537 0.384352444
30 0.706316243 0.380215579
31 0.730454634 0.374145061
32 0.753347528 0.366286306
33 0.774971854 0.356801384
34 0.795316865 0.345865178
35 0.814383239 0.333661549
36 0.832182106 0.320379615
37 0.848734008 0.306210184
38 0.864067821 0.291342444
39 0.878219664 0.275960944
40 0.891231810 0.260242909