Since the number of green and blue marbles is the same, and the number of green marbles is divisible by 8, and the blue marbles by 6, the number of green marbles (and of the blue marbles) must be a multiple of both 6 and 8. The least common multiple of 6 and 8 is 24. So there can be either 24 blue and 24 green marbles, leaving 52 for red and yellow, or 48 blue and 48 green marbles, leaving 2 for red and yellow.
Since red and yellow are the same number, there could be either 26 yellow, or 1 yellow. Since 1 isn't given as an option, it has to be C) 26.