All perfect praise be to Allah, The Lord of the Worlds. I testify that there is none worthy of worship except Allah, and that Muhammad is His slave and Messenger.
The criterion of eligibility for unemployment benefits depends on the conditions stipulated by the grantor.
If you received these unemployment benefits according to the conditions stipulated by the grantor, there is nothing wrong with it and you don't have to return the money. However, if you received the unemployment benefits while lacking the eligibility criteria, then it is impermissible to keep such money, and you have to return it to the grantor.
The fact that you did not know that it is impermissible for you to keep such benefits does not waive the obligation of returning such money to the grantor after you knew that you are not entitled to these benefits.
For more information, please refer to Fatawa 90454 and 447424.
Allah knows best.