Self Occupied Property (SOP) & Tax implications

Can you take a Home Loan and also Claim LTCG Tax Exemption on Sale of Real-Estate Property?