One way to solve is with inclusion-exclusion.

I assume leading zeroes are not allowed.

# of r-digit numbers having no 0's is 9^r, for no 1's it's 8*9^(r-1) and same for no 2's.

# of r-digit numbers having no 0's and no 1's is 8^r, same for no 0's and no 2's, and for no 1's and no 2's it's 7*8^(r-1).

The number of r-digit numbers having no 0's, 1's, or 2's is 7^r.

Apply

This gives you the complement set of what you're really trying to count, so subtract it from 9*10^(r-1), alternatively calculate probability and subtract it from 1.