You are talking of two different countries, each with its own set of Labour laws which are different. Your EOS benefits for your number of years of service in Qatar will be calculated as per Labour laws of Qatar. The number of years of service in S Arabia cannot be calculated as per Qatari Labour laws.
As per my last information, your first first five years will be calculated as 21 days of basic salary for each year of service. The remaining period will be 28 days (possibly 30 days as I am not sure of this) of basic salary.