How many number with 4 digits, beginning with $1$ and have exactly two identical digits?

Your cases look good.

There are $9 \cdot 8$ numbers of each of your cases ($x$ can be any digit but 1, so 9 choices, and $y$ can be any digit but 1 or x, so 8 choices). So the total is $$\underbrace{9 \cdot 8}_{11xy}+\underbrace{9 \cdot 8}_{1x1y}+\underbrace{9 \cdot 8}_{1xy1}+\underbrace{9 \cdot 8}_{1xxy}+\underbrace{9 \cdot 8}_{1xyx}+\underbrace{9 \cdot 8}_{1yxx}=6\cdot 9 \cdot 8=432$$ numbers.


We can find out how many numbers have no repeated digits. There are $9 \cdot 8 \cdot 7 =504$

How many numbers have two different repeated digits. There are three different paces would could stick a 1, and then nine other digits we can use to make a pair in the two remaining spots. So $9 \cdot 3 = 27$

How many have three identical digits? There are $\binom{3}{2}$ places we could stick two more ones, and then 9 other digits. So $3 \cdot 9$. And then nine other numbers of the form $1xxx$. So 36 total.

There is one number with four repeated digits.

So the number of numbers with exactly two repeated digits, is 1000 minus everything we found above,

$1000 - 504 - 27 - 36 - 1 = 432$