The experiment is to throw the die $n=7$ times and get 5 exactly twice.

It is a case of Bernoulli trials as it satisfies the conditions (i) finite number of trials, (ii) independent trials, (iii) there is a definite outcome and (iv) the probability of success does not change for each trial.

P (getting a 5) $=p = \large\frac{1}{6} \rightarrow$$q = 1 - p = \large\frac{5}{6}$

Let X be the number of times we get a 5 exactl twice, in 7 throws of die. X has a bionomial distribution, the probability of x success in n-Bernoulli trials, $P (X = x) = \large^{n}C_x. p^x.q^{n–x}$ where $x = 0, 1, 2,...,n$ and $(q = 1 – p)$

P (getting a 5 exactly twice) $= P (X = 2) = \large^{7}C_2. \large\frac{1}{6}^2.\large\frac{5}{6}^{5}$

$P (X = 2) = 21 \large\frac{1}{36} \frac{3125}{7776} = \frac{21875}{93312}$