The perfect construction HAVE + past participle imputes a state to the subject.
Consequently you cannot say "Einstein has visited the Phillipines" because (being dead) Einstein is incapable of sustaining the state of having visited the Philippines.
But you can say "Leo is the best president our country has ever had", because your country still exists (I assume) and can sustain the state of having had Leo as president.
However, you are not required to use the present perfect; you may also use the simple past, "Leo is the best president our country ever had".
Furthermore, you may also say "Leo was the best president our country (has) ever had." That really depends on how "present" Leo is to your memory.
What you may not say is "Leo is the best president our country had ever had". The past perfect must be related to a point in the past, but your main clause here is in the present. If you use the past perfect in the relative clause, your main clause must be in the past: "Leo was the best president our country had ever had", meaning he was better than any of his predecessors". But this does not compare Leo to his successors. He may or may not have been better than them.