if you are having Residence Permit, you should get an Exit Permit from your sponsor. For coming back, there is no Re-entry is required if your visa is valid. If you are under the visit visa for six months or three months and u want to go outside Qatar and to return with the same visa you need to get a Re-entry permit.