Ahmad Shah DURRANI unified the Pashtun tribes and founded Afghanistan in 1747 .