The assignment doesn't have numerical answers, and I always make little errors with counting, so I'm just checking my work here.
Let $E_j$ be the event that the digit $j$ appears at most three times.
We need to find $|E_1\cap \dots \cap E_9|$
Since $E_1^C,...,E_9^C$ are mutually disjoint and all have the same size, we can say $$|E_1 \cap \dots \cap E_9|=9^6-|E_1^C \cup ... \cup E_9^C|=9^6 -9|E_1^C| $$
$E_1^C$ is the event that the six digit number has $4,5, \text{or } 6$ ones. So, by counting the number of ways we can insert the one digits and then filling in the remaining slots with digits other than $1$, we get we have $$|E_1^C|={6 \choose 4}8^2+{6\choose 5}8+{6\choose 6}=1009$$ Finally, $$|E_1\cap \dots \cap E_9|=9^6-9\cdot 1009=522,360$$
Thoughts?
As lulu says in the comments, your work (and answer) appears to be correct.