"He's not an old friend" Shouldn't be counted as a correct answer, the portuguese phrase for that would be: "Ele não é um velho amigo" or "Ele não é um amigo velho".
By the way english is ambiguous on that phrase whereas portuguese is not, he's either "um velho amigo" - "a friend of old" (time), or "um amigo velho" - "an old friend" (age).
"Um amigo qualquer" does not refer to age, it's just saying he is not just any friend, he's special.
Hope I've helped someone, native speaker by the way.
You have to think of "just any" as a single semantic concept that has this special meaning when the words occur together. You need both to convey the meaning of "qualquer" in this sentence. "Any old" or "just any old" mean the same thing but are more suitable for very casual speech.
The expression means that this friend is not a normal friend, there is something that makes him more special than the others. In English the most common phrase to say is the one given by duolingo (or possibly: ´he´s not just any old friend´ - (it has nothing to do with age). It´s an expression, so that´s why all the exact words are not translated into Portuguese, similarly if you directly translated the Portuguese expression into English is wouldn´t make sense, you need to add the ´just´ for it to mean the same.
Probably the best English translation would be "He is no ordinary friend" (which DL currently does not accep), though that might not be very helpful for a Portuguese speaker to learn, because it's a slightly unusual turn of phrase; indeed, one might say it was no ordinary sentence.