We throw $5$ dice: What is the probability to have $4$ different numbers?
Notice that for a favorable outcome, exactly two of the five dice must display the same number, while each of the other three dice must display different numbers.
Suppose the dice are five different colors so that we can distinguish between them. There are $\binom{5}{2}$ ways for two of the five dice to display the same number and $\binom{6}{1} = 6$ possible numbers for those two dice to display. There are five possible numbers remaining for the other three dice to display. The number of possible ways those three dice can display the numbers is $5 \cdot 4 \cdot 3$ (where we list the outcomes as ordered triples in the order the colors appear in an alphabetical list). Hence, the number of favorable outcomes is $$\binom{5}{2} \cdot 6 \cdot 5 \cdot 4 \cdot 3$$ from which we obtain the probability $$\frac{\binom{5}{2} \cdot 6 \cdot 5 \cdot 4 \cdot 3}{6^5}$$ that exactly four different numbers are displayed when five dice are rolled.
You can throw one by one $5$ dice.
Discern events $AXBCD$, $ABXCD$, $ABCXD$ and $ABCDX$ where e.g. $ABCXD$ stands for the event that the fourth throws give the same result as one of the former throws and there are exactly $4$ distinct results.
The events are mutually exclusive so the probability to get exactly $4$ different numbers is:$$P(AXBCD)+P(ABXCD)+P(ABCXD)+P(ABCDX)=$$$$\frac66\frac16\frac56\frac46\frac36+\frac66\frac56\frac26\frac46\frac36+\frac66\frac56\frac46\frac36\frac36+\frac66\frac56\frac46\frac36\frac46=\frac56\frac46\frac36\left(\frac16+\frac26+\frac36+\frac46\right)$$