Only Qatari nationals are eligible for benefits.
Most expats are in Qatar for a contracted period of work, and once that expires or employment is terminated, they return to their home country.
Also note that visas are often tied to a work contract, so once a work contract ends, your visa may expire or be terminated. Make sure you are familiar with the details of your work contract and visa to avoid any issues.
The State of Qatar does offer unemployment benefits to Qatari citizens, but not to expats.