In your comparison routine you will need to code how it determines which element comes first.
So if you sort, say, people first by age then by height, this means you first compare two people's ages, then if those are equal you compare the heights. Let's say you're writing a function to determine if person1 > person2:

1: If person1.age > person2.age then we return TRUE immediately.
2: If person1.age < person2.age then we return FALSE immediately
3: If person1.age == person2.age then we need to look at the height
3a: person1.height > person2.height so we return TRUE
3b: person1.height <= person2.height so we return FALSE.