It’s custom to kiss the hands of a priest after he blesses you.
It’s custom to kneel on the left knee and kiss the ring of a bishop, archbishop, or cardinal whenever you come into his presence, AND when he is your diocesan bishop.
It’s custom to bow at the waist and kiss the ring of a bishop, archbishop, or cardinal whenever you come into his presence, when he is NOT your diocesan bishop.
It’s custom to kneel on the left knee and kiss the ring of the pope whenever you come into his presence.
It’s custom to only kiss the ring of whoever is the highest “ranking” person. So, if you’re with a cardinal and your diocesan bishop, you’d only kiss the cardinal’s ring, but you’d bow at the waist instead of genuflecting, because he’s not your diocesan bishop. But you’d still only kiss the cardinal’s ring, because he’s the highest “ranking” person present.