If 8 marbles are chosen, it would be possible to have just two of each colour, and that would not fulfil the condition.
However, the ninth marble to be drawn would be the third of that colour, and so 9 marbles are needed to ensure that at least three are of the same colour.