Taliban militants have taken control of vast areas in Afghanistan as thousands of civilians leave their homes taking refuge in camps or neighboring countries.