Thrown off 2nd story roof age 2 ended with severe sprain both legs. Pain in legs lasted till now age 27. Why do my knees/hips hurt even when bending?

Thorough work up . I agree that x-rays are a good place to start. A good evaluation to determine if the discomfort is coming from the bones, muscles, or nerves is helpful and can help direct treatment. One cleared, a tailored exercise program developed by a physical therapist will help you find ways to achieve your goals with minimal discomfort.
Posttraumatic joints. You likely suffered injuries that may have triggered what is called posttraumatic arthritis, which is the premature development of degenerative changes in a damaged joint. All weightbearing joints will degenerate over time, but a significant injury can accelerate this process. Stiffness and pain are hallmark symptoms. X-rays could confirm the findings.