How to breed these types of dragon which have special elements (not fire, earth, plant etc.) on their tag in the game. They just have a sun, a moon or a rainbow. What basic elements should be mixed for each of them? Which kind of (hybrid I suppose) dragons should I mix to obtain those ones?

Rainbow Dragons need at least 4 elements while Sun and Moon require Lightning and Cold. Sun Dragons can be bred between 7AM and 7PM on your device clock. Moon Dragons can be bred between 7PM and 7AM on your device clock. There are several possible combinations that can be used as listed on this handy chart.