To solve this problem, we can use Pythagorean theorem, it tells us that the square of the hypotenuse is equal to the sum of the square of the other two sides.
When we look at these side lengths, we can see that only the second answer is suitable because from the lengths, we can predict that 13 is the length of the hypotenuse, 5 is the length of the shorter leg and 12 is the length of the other leg, and when you actually calculate it, the result is correct as well: