The Binomial distribution gives a fancy and quick answer.
The probability of having the same number on the rolled success is
$$
P(\text{Having } t \text{ equal numbers}) = \mathcal{B}(t,N,p_1)\cdot\mathcal{B}(t,t,p_2)\cdot N_f
$$
where
- \$t\$ is the target number of successes
- \$N\$ is the number of dice rolled
- \$p_1\$ is the probability to have a successfull roll
- \$p_2\$ is the probability to get the same number on each face of the successfull roll
- \$N_f\$ is the number of "good sides" of the die for having a success.
The Python code below implements the above reasoning.
import numpy as np
from scipy.stats import binom
# Number of rolls
N = 6;
# Type of dice
D = 6;
# Success Threshold
sT = 4;
for nSucc in np.arange(1,D+1):
probability = binom.pmf(nSucc,N,(D-sT+1)/D)*(D-sT+1)*binom.pmf(nSucc,nSucc,1/(D-sT+1))
print('Chances to get %d equal numbers on a %d d%d roll: %2.2f%s'%(nSucc,N,D,probability*100,'%'))
Mathematical explanation.
The binomial distribution of parameters \$(N,p)\$ computes the probability of successes in \$N\$ trials, assuming a probability \$p\$ for success. Let's use the following notation:
$$
\mathcal{B}(m,N,p)
$$
which denotes the probability to get \$m\$ success on \$N\$ trials, having a probability \$p\$ of success.
Let's compute the probability to get a successful roll on a 6d6 with 4+: in this case, a useful result on a die is achieved with a probability of 50% (i.e. the chance to get a 4, a 5 or a 6 on a d6). In this case, referring to the formula at the beginning, we have \$N=6,\, p_1=0.5\$.
Let's focus on the case in which one needs two 4+ on a 6d6 (\$t=2\$): the probability of having two equal numbers given a successful roll is
$$
P(\text{two equal numbers}|\text{successful roll}) = P(\text{successful roll})\,P(\text{Having two equal numbers}).
$$
The binomial distribution tells us that getting 2 successes on a 6d6 has a probability of
$$
P(\text{successful roll}) = \mathcal{B}(2,6,0.5)=23.44\%.
$$
Since we know that we have exactly 2 dice which are successful, we have to compute the chance to have the same number on each die:
$$
\begin{split}
P(\text{Having two equal numbers}) = &P(\text{two 4s}) + P(\text{two 5s}) + P(\text{two 6s}) \\
=&\frac13\frac13+\frac13\frac13+\frac13\frac13 = 3\frac19 \\
= & \frac13 = 33.33\%
\end{split}
$$
or, since we are counting to have exactly two successes on two trials with probability 1/3,
$$
P(\text{Having two equal numbers}) = 3\,\mathcal{B}(2,2,1/3) = 33.33\%
$$
and referring again to the formula at the beginning, it means that \$p_2=1/3\$, \$N_f=3\$.
Then, the final probability is given by
$$
P(\text{two equal numbers}|\text{successful roll}) = 23.44\%\,33.33\% = 7.81\%
$$
according to the answers by posita and SomeoneEvil.
When the number of successes is 3, then
$$
P(\text{3 equal numbers}|\text{successful roll}) = \mathcal{B}(3,6,0.5)\mathcal{B}(3,3,1/3) = 3.47\%.
$$