Rite Aid's chief legal officer, Paul Gilbert, is leaving the pharmacy chain after less than three years with the company.