there are two choices

either he goes out of the country and waits for his work visa and re-enters without any issues.

Or CID will deport him and blacklist him from reentry into Qatar.

This is up to the authorities, and you have to consider the fact that it's almost 4 months on an expired VISA (Illegal in the country)

Regards!!