5 0 0 = 3 ways - any of the 5 candies can be given to one person
4 1 0 = 6 ways = one candy can be given to any one person (3 ways) and the other 4 can be given to one of the other two (2 ways) ...so...3 x 2 = 6
3 2 0 = 6 ways - any of the three candies can br given to one person (3 ways) and the other two can be given to one of the other two (2 ways)...so....3 x 2 = 6
3 1 1 = 3 ways - any of the 3 candies can be given to any one person (3 ways) ...since the other two candies are indistinguishable...we can distribute them to the other two people in any manner
2 2 1 = 3 ways - any 1 of the candies can be given to any of the three people....the other 4 can be split equally between the remaining two people
So... 3 + 6 + 6 + 3 + 3 = 21 ways