Terrorists are persons who directly and intentionally target noncombatant civilians as a means to achieve political goals.
by this definition, lots of US soldiers are terrorists, they kill (sometimes intentionally, sometimes not, sometimes forcedly) civilians in Libya, Iraq (where nuclear weapon not found), Syria, Vietnam in old days and in many more countries
Taleban attacking a military base are not terrorists by that definition
Of course, they are defending their own place, what the hell is military base of different country is doing something in totally different country, maybe occupation? which means using terroristic acts