In that sentence that you used, the term "LIVING" would be a noun.
1.) "After living here for five years" and 2.)"After have been living here"
the first one is used present to past tense. while the second one is past to future tense.
[confused? well lets put it this way, the term AFTER AND BEEN are both past tense therefore, you used that phrase and made it a double negative.] which makes both sentences completely different ^^
I hope this answers your question and able to solve your curiosity. (I'm not sure if its correct, but i tried... hehe)