Is recommendation letter (faculty position) a completely professional thing ? I mean I completed PhD one year ago, I had good relation with my Phd advisor when I was his student. After that I left my country for postdoc and obviously the relation is not like earlier. Does keeping good relation influences recommendation letter or it is completely professional thing ?
If you did well during your PhD (and did not have a fight with your supervisor afterwards), your supervisor should write a good recommendation letter. Recommendation letters are professional and you do not need to keep a good personal relation. It happens often that people have to ask for recommendation letters some time after moving on to somewhere else.
The only advantage of being still there could be that it would make it easier to remind your supervisor if he takes too long to write the letter.
I would like to a highlight something without disagreeing Wimi. Some PHD programs require recommendation letters to mention your social skills. Even if they don't, it is beneficial for you if your recommender thinks you have good interpersonal skills, able to communicate well etc. Depending on what you mean by "good relationship" this might be quite relevant. However, if you have had a decent interpersonal relationship, you should be okay. From what I have seen people seem to understand how distances effect relationships quite well. I do not think there will be resentment just because there had been some physical distance between you.
Actually, it isn't an either/or thing. It can and should be both.
You should try to keep in touch with your advisor, keeping them up to date on what you are doing. But the reason is that you want them to remember you when it comes time for recommendations and not have to search their memory for something good to say about you.
You don't have to socialize with them. An occasional email is enough. Papers you have submitted, children born, anything. The thread can be pretty thin, but if you maintain it you will get a better letter in most cases. If you live in approximately the same place, an occasional visit is worth doing.
And maybe they will also respond generally and do things that might otherwise boost your career. Introducing you to others with similar interests, perhaps.