The units digit of a squared number is equal to the units digit of that number only for digits 1 (1^2=1), 5 (5^2=25) and 6 (6^2=36). So a and b must end with 1, 5 or 6.
Now let's try all the combinations of these:
1*5=5, not good since 5 is already used.
1*6=6, not good since 6 is already used.
5*6 =30, unit digit 0, not used!!
so a*b has units digit 0.