Beside Someone_Evil's excellent answer, I would like to add a mathematical contribution, in order to generalize the above rule for large number of \$X\$ and for different dice.
On a first hand, observe that the score \$v\$ under the above rules is given by
\begin{equation}
v = h+s-1
\end{equation}
where \$h\$ is the highest roll among the dice and \$s\$ is the number of realizations of such roll. Consider for example \$v=3\$ within rolling 3d6: the outcomes that provide with such result are
- (1,1,1)
- (2,2,1), (1,2,2), (2,1,2)
- (3,1,1), (1,3,1), (1,1,3), (3,2,1), (3,1,2), (2,3,1), (1,3,2), (2,1,3), (1,2,3), (3,2,2), (2,3,2), (2,2,3)
Observe that the last one can be summarized in just 3 cases (3,\$x\$,\$y\$), (\$x\$,3, \$y\$), (\$x\$,\$y\$,3), where \$x<3\$ and \$y<3\$.
Hence:
- \$h=1\$, \$s=3\$ \$\to\$ \$v=1+3-1=3\$
- \$h=2\$, \$s=2\$ \$\to\$ \$v=2+2-1=3\$
- \$h=3\$, \$s=1\$ \$\to\$ \$v=3+1-1=3\$
Obviously, when the highest roll is 4 or more, one can not get a score of 3. Compute now the probabilities of the above realizations, where \$P(v|h=k)\$ means the probability to have a score of \$v\$ when the highest result from the rolls is \$k\$:
\$h=1\$: \$P(3|h=1)=P(\mbox{get all 1s})=(1/6)^3\$
\$h=2\$:
$$
\begin{eqnarray}
P(3|h=2)&=&P(\mbox{get exactly 2 2s})\cdot P(\mbox{get 1 roll less then 2})\cdot(\mbox{num of equivalent realizations})\\
&=& \left(\frac16\right)^2\cdot F(1)^1\cdot 3 = \left(\frac16\right)^33
\end{eqnarray}$$
where \$F(x)\$ is the cumulative distribution function: \$F(x)\$ gives the probability to get a result less or equal than \$x\$, hence if we want to compute the probability to get a number strictly less than 2 we have to compute \$F(1)\$.
\$h=3\$:
$$
\begin{eqnarray}
P(3|h=3)&=&P(\mbox{get exactly one 3})\cdot P(\mbox{get 2 rolls less then 3})\cdot(\mbox{num of equivalent realizations})\\
&=& \left(\frac16\right)^1\cdot F(2)^2\cdot 3 = \left(\frac16\right)\left(\frac13\right)^23
\end{eqnarray}$$
\$h\geq 4\$: \$P(3|h\geq4)=0\$
The probability of getting a score of 3 is then
$$
P(3) = \sum_{i=1}^6P(3|h=i)
$$
We are now able to generalize the above pattern: let \$f(x)\$ be the probability of getting \$x\$ with a roll, \$F(x)\$ the cumulative distribution function and \$\begin{pmatrix}n\\k\end{pmatrix}\$ the binomial coefficient, which gives all the ways of picking up \$k\$ objects among \$n\$ without taking into account the order. Let's consider a die with \$D\$ faces: the probability of scoring \$v\$ with a XdD roll is given by
$$
P(v) = \sum_{i=1}^D P(v|h=i) = \sum_{i=1}^D \begin{pmatrix}X\\s_i\end{pmatrix}f(i)^{s_i} F(i-1)^{(X-s_i)}
$$
where \$s_i\$ is the number of successes needed when the highest roll is \$i\$ and \$F(0)=0\$. The term \$f(i)^{s_i}\$ is the probability of getting exactly \$s_i\$ successes, \$F(i)^{X-s_i}\$ is the probability that the remaining rolls are lower than \$i\$. Finally, the binomial coefficient takes into account the equivalent sequences.
As an example, consider the case of rolling 5d4:
- P(2) = 0.49%
- P(3) = 8.79%
- P(4) = 48.34%
- P(5) = 30.86%
- P(6) = 9.86%
- P(7) = 1.56%
- P(8) = 0.10%
The figure down below, instead, depicts the distribution when the number of rolled d6 ranges from 3 to 60: the yellower, the higher the probability. The computation has been done in Python.
As a curiosity, as the number of rolled dice increases, the distribution resembles a Gaussian one (with \$r^2\$ close to 0.99), as it is clear from the figure below (credits to Kieran Mullen for pointing out that a 3D plot could be more clear). Indeed, as Someone_Evil pointed out in the comments, for large \$N\$ (about 30-35) the probability to get at least one 6 is close to 1: hence, the above distribution is simply a Binomial one. Moreover, as \$N\$ approaches infinity (in real life, it means that it is large, in this case about 30) the binomial distribution is approximated by a Gaussian one.