Update [2015-12-14]: Thanks to the fruitful comment of @robjohn I've updated the answer to also include the range $r>365$.
Domain considerations: $3\leq r \leq 365$
$r=1,2$: We can exclude the trivial cases $r=1$ and $r=2$ which give a probability of zero, since we never reach a configuration with three people having the same birthday.
$2<r\leq 365$: The main part where we put the focus of our analysis. Fortunately the reasoning can be easily extended to $r\leq 730$.
$365<r\leq 2\cdot 365$: Assuming the year has $365$ days, the situation becomes more complicatedslightly different if the number of people is greater than $365$. In these cases it is guaranteed that there are people with the same birthday and this needs a more detailed analysis leading to a generalisation of the formula stated at the endsome additional thoughts.
$r>2\cdot 365$: According to the pigeonhole principle groups with more than $730$ people have at least three equal birthdays with probability $p=1$.
For convenience only we consider the simplified problem
$$3\leq r \leq 365$$
But, even this simplified problem is not trivial. In order to get a first impression and to have a verification for small numbers at hand we look at a smaller example.
This example It should be small enough to make calculations easy and large enough to be representative for the problem.
Most of the work has been done by the small example. If we now consider $365$ days and $r$ people we can go on straight forward.
At first we put the focus at
\begin{align*}
3\leq r \leq 365
\end{align*}
- Let's denote with $N_{(1^{r})}$ the number of $r$-tuples with all entries pairwise different. The exponent in the index $1^{r}$ denotes the multiplicity of $1$.
The range $365<r\leq 2\cdot 365$
If $r>365$ it is guaranteed that at least two people have the same birthday. It follows
$$N_{(1^r)}=0$$
We see after short consideration, the approach (4) for a group of people with $1\leq k\leq \lfloor r\rfloor$ distinct pairs is also valid up to $r\leq 730$.
Now it's time to harvest. In order to find the number of all $r$-tuples we have to exclude, we sum up $N_{(1^r)}$ and $N_{(1^{r-2k}2^k)}$ for $1\leq k \leq \lfloor\frac{r}{2}\rfloor$.
In fact, inspired by the comment of @robjohn, we can also respect all other values of $r$ in the same formula, if we take $\frac{1}{n!}=0$ for $n<0$ and finally obtain
The probability $p$ that at least three people from a group of $3\leq r\leq 365$$r\geq 1$ people have the same birthday is according to (3) and (4)