Yes, you will need an exit permit to leave. If your residency permit has been cancelled you will need an NOC to come back even as a tourist - or at least that is what SOME US citizens have experienced. In Qatar, it is not always possible to give a definitive answer. Can you get an NOC just in case?