Generating functions and multiplicity formulas: The case of rank two simple Lie algebras