Since the sum of the numbers on the three draws is 12, if we want the card numbered 2 to be drawn exactly two times, the third card can only be numbered 8. In fact, , and there are no other possibilities, unless you consider the various permutations of the terms.
So, we have three favourable cases: we can draw 2,2,8, or 2,8,2, or 8,2,2. This are the only three cases where the card numbered 2 is drawn exactly two times, and the sum of the number on the three draws is 12.
Now, the question is: we have three favourable cases over how many? Well, we have 5 possible outcomes with each draws, and the three draws are identical, because we replace the card we draw every time.
So, we have 5 possible outcomes for the first draw, 5 for the second and 5 for the third. This leads to a total of possible triplets.
Once we know the "good" cases and the total number of possible cases, the probability is simply computed as