What is the total number of ways in which 5 balls of different colours can be distributed among 3 persons so that each person gets at least one ball?

The correct answer is 150 and I understand how it needs to be done.

However, my question is: Why can't we solve the question in the following way:

First we take any 3 balls out of 5 and distribute one ball each to the 3 persons. This can be done in C(5,3)*3! ways.

Now we are left with 2 remaining balls. So, we can do either of the following:
i) Give both those balls to one person. This, I believe, can be done in C(3,1) ways Or
ii) Give one ball each to two persons. This, I believe, can be done in C(3,2) ways

So, total number of ways in which 5 balls of different colours can be distributed among 3 persons so that each person gets at least one ball = C(5,3)*3! *[C(3,1) +C(3,2)] = 360

What is wrong in the above approach? As I mentioned, the correct answer is 150.

There are $\dbinom{3}{2}$ ways to choose the 2 people that get 2 balls.
Then we choose a ball from the 5 and give it to the person that gets 1 ball.
We choose 2 balls from the remaining four and give it to one of the people that gets 2 balls. The 3rd person gets the remaining balls.

So we have

$\dbinom{3}{2}\dbinom{5}{1}\dbinom{4}{2} = 3 \cdot 5 \cdot 6 = 90$ ways to arrange the 5 different balls among 3 different people where 2 people get 2 balls.

There are $\dbinom{3}{1}$ ways to choose the person that gets 3 balls.
We choose 1 ball from 5 and give it to a person that gets 1 ball.
We choose 1 ball from the remaining 4 and give it to the other.
The third person gets the remaining 3 balls.

If green and red are received by the person who already has blue, you get the same result as when that person already had green and then receives red and blue. As you count the same result three times, your count needs to be divided by three.

A particular result, such as person 1 receives red and green, whilst person 2 receives blue and yellow is achievable in C(2,1) (or P(2,2)) ways, which is 2 (or 2!), for each person.

In the above example, person 1 can receive red first or green first, and person 2 can receive blue first or yellow first. That's 2*2 = 4 ways in total, which you had counted as four results, rather than just one.

The general formula you wanted would depend on how the problem is generalized.