Stacking increases the power of tiles that hit enemies. Basically it considers the sum of the attack stats of all heroes of that color. So on offense/attack - better to stack
on defense, this does not apply, so generally better to have one hero per color (Rainbow).
what are their levels currently? if you’re just starting out and don’t have ascension materials - best to focus on one of each color. Start with 3s (because you can max them easily), then move to 4s, then slowly build up 5s. It takes a while to get all t he materials you need to ascend a single 5, after all.
Red: Puss in Boots, Gormek, Boldtusk, Colen, Reuben, Scarlett → do Scarlett first, fast speed + attack debuff will keep you alive. Then Boldtusk for the heal + attack boost, then Gormek for the defense debuff. (I am assuming you will do Melendor first to have a healer, so I recommend Scarlett first. if you do not work on Melendor, then do Boldtusk first. Gormek goes last because you have Tiburtus, who has the same special skill).
Green: Kashrek, Melendor, Caedmon → Melendor first, he heals and dispels, two very important thing. Then Caedmon (unless you have his costume, do Caedmon first). Leave Kashhrek for last (though if you get his costume it is very good!)
Purple: Quintus, Tiburtus, Obakan → Tiburtus, as the only 4*. the defense debuff is very good!
Blue: Sonya, Boril → Sonya for the dispel, fast mana and snipe. Then Boril, riposte is quite useful when starting out.
Yellow: Li Xiu, Hu Tao, Wu Kong → What kind of Titans are you fighting? If you are struggling, then Wu Kong to increase Titan score. otherwise, Li Xiu for the mana cut is useful against bosses and in raids.