Bahrain visa

I was in Bahrain and have a valid CPR and Residence Visa. My Residence Visa is valid till july of 2020.
In January 2019 i had to travel out of bahrain for medical reasons and am planning to come back in August 2019. That is around 8 months.

I would like to know if there any requirements from immigration on this or i can stay out of bahrain as long as my residence visa is valid.

Thanks

I think you got your dates wrong.

Assuming your visa expires in July 2021 and you want to come back in August, correct?

You can't come back with an expired visa.  Your sponsor needs to apply for a new one.  I would suggest you come back in July and renew the visa.  Easier and less hassle.