It's always the five best cards. If the hand is made out out 4 cards and you have the same one, the fifth decides. If the hand is made out of 5 cards and you have the same, you'll split.