Why would my back of my legs hurt when I walk and I get light headed to. When I walk for to long my legs hurt and sometime I get light headed an have to stop.

NEED TO CHECK HEART. This sound like claudication. Advise to see a cardiologist to evaluate your lower leg vessels and heart.
Check . Check your cardiovascular status. You may have plaques in your arteries causing peripherovascular insufficiency and other occlusive problems to your heart or to the carotids.