For the number to be divisible by 6, the sum of the digits should be divisible by 3 and the units digit should be even. Hence we have the digits as
Case I: 2, 3, 4, 6
Now the units place can be filled in three ways (2,4,6), and the remaining three places can be filled in 3! = 6 ways.
Hence total number of ways = 3*6 = 18
Case II: 0, 2, 3, 4
case II a: 0 is in the units place => 3! = 6 ways
case II b: 0 is not in the units place => units place can be filled in 2 ways( 2,4) , thousands place can be filled in 2 ways ( remaining 3 - 0) and remaining can be filled in 2! = 2 ways. Hence total number of ways = 2 * 2 * 2 = 8
Total number of ways in this case = 6 + 8 = 14 ways.
Case III: 0, 2, 4, 6
case III a: 0 is in the units place => 3! = 6 ways
case II b: 0 is not in the units place => units place can be filled in 3 ways( 2,4,6) , thousands place can be filled in 2 ways (remaining 3 - 0) and remaining can be filled in 2! = 2 ways. Hence total number of ways = 3 * 2 * 2 = 12
Total number of ways in this case = 6 + 12= 18 ways.
Hence the total number of ways = 18 + 14 + 18 = 50 ways