getting confused about have,had with verbs

hi there,
i’m just wondering if you can help me to understand this.

whats the difference between:
I have met him before
I had met him before

your explanation is truly appreciated

I use the present perfect aspect with the adverb of time before for either an action or event that has happened in the simple but indefinite past before now (the time of speaking is now) Without before I use the present perfect just to express the fact that something has happened.

Have I seen you before?
No, you haven’t.

I had met him before could be correct but in a context only from which it could be seen easily that another action took its place after I met him and there was a time distance between the two events, one in the deep past and one in the simple past(the time of speaking)

I saw him last night. When I saw him I got on my mind that I had met him before.
How happened that i didn’t see him with you.
He had left before you entered.

Is this correct?

Past perfect is used when an action happened before another in the past.

Mr-E2e4 thx a lot for your passing by.you have been very helpful.