The height of the building and the distance between the house and the ladder are the legs of the triangles. He set up the formula correctly but plugged in the values in the incorrect areas
Let’s use his formula
Leg A^2 + Leg B^2 = Hyp^2
The house is one of the legs and the ladder is the hypotenuse
(15)^2 + Leg B^2 = (17)^2
Let’s isolate Leg B because we hate it and need to find it’s value.
Leg B^2 = (17)^2 - (15)^2
Let’s get rid of these exponents
Leg B^2 = 289 - 225
Subtract
Leg B^2 = 64
Leg B = 8