Logic is simple.
Want to check items
Such as mana available, cards in hand and the order to play cards.
So check you have enough mana with condition rules,
then with gain rules, get it to give higher gain to card A to play first, then 2nd card check if card a is in play then give higher gain to cast for that.
Hope that helps.