Assuming you mean mission mode, it comes down to exceeding the targets rather than merely finishing.
Collect more items than the mission strictly asks for, or build up a higher score and more rings than the baseline requirement. Do that and you are awarded silver or gold medals, and the medal is how the game tells you that you cleared the mission at the top rank.