1)Last legs
-Daniel knew his phone was on its last legs after he dropped it.
-Tina's oven was on its last legs after the big Christmas dinner she cooked.
-Jim's computer was on its last legs.
Meaning:
worn out, tired, run down, and ready to die or otherwise cease working.
2) The final leg
-When we went to watch the grand prix formula one race, it was so exciting when the drivers shot past us on the final leg of the race.
-Tim was really happy when he got to the final leg of his report.
-Jeff has been working really hard recently, but he is finally on the final leg of his exams.
Meaning:
at the end of a project, event or activity.
3)A leg up
-Speaking Chinese gave Tom a real leg up on the competition.
-Bill's dad was a mathematician so he had a leg up on his classmates.
-Using the best cosmetic products gave Tina a leg up on the competition in the modeling industry.
Meaning:
an advantage