Whats the question

The holder of the residence permit is interested in sponsoring his friend and bring him to Qatar on a visit visa (This is possible)

Or

The holder of the residence permit is interested in sponsoring his friend and his friend happens to be in qatar on a visit visa (You have to be a Qatari in order to do that)

hope this clears up everything