Note: Two ways are only distinct if one cube can't be rotated to look like the other.
Put the green anywhere. Now, consider all the ways to put the blue: 1. One opposite the green and the other anywhere else. 2. Two blue adjacent to each other. (None of them opposite to the green) 3. Two blue opposite to each other. Now put the red.