X is the number of times you get a match between the two dice in three attempts. Since there are only 3 attempts, then you can't get any more than 3 matches.
P(match on any attempt) = 1/6
P(no match on any attempt) = 5/6
This is now just like a binomial experiment, with n=3 trials, p(success)=1/6, p(fail)=5/6.