First, it doesn't matter whether we consider the first and fourth balls or the first and second balls, so the question is basically asking you to divide the combinations up into the ones that have the same or different colours for any fixed pair of balls. The sum of the two numbers must be the total number of combinations, which you already know, so we only have to determine one of the two, whichever we find easier. I find it easier to think about the three cases of two balls of the same colour than about the three cases of two balls of different colours, so I'll go for that.
If the two fixed balls are red, you have $3$ red, $8$ blue and $3$ green left. Since you knew how to calculate the number of combinations for $5$ red, $8$ blue and $3$ green, you can probably calculate this number, too. Likewise, if the two fixed balls are blue, you have $3$ red, $6$ blue and $3$ green left, and if they're both green you have $5$ red, $8$ blue and $1$ green left. Then you just have to add those three numbers.
There was a question in the comments whether balls of the same colour are considered to be distinguishable: I assumed in this answer that they aren't, but I suspect that you're being asked to calculate a probability anyway; if so, the factor $5!8!3!$ for the number of permutations of balls of the same colour appears in both the numerator and the denominator if you treat them as distinguishable, so it cancels and the probability is the same, as one might expect.