When there is an "extension" after the pronoun (that is, another word), then you should use the form without "н".
In this case (variant 2) pronoun has the function of adjective (in russian it is called "местоименное прилагательное").
For example - с помощью его ключа, до его прихода, до её выступления, после их встречи.
Variant 1 - it is called in russian "местоименное существительное". In this case you should use the form with "н".
In this case pronoun has some sintaxis functions, as of the noun. In this case there is no extension (other words) after this pronoun. I mean, there are words of course in the sentence, but these word combinations are a kind of finished ones by meaning.
For example: с помощью него, после них.
I hope that's helped a little.