If the sex offense is a felony, it does not matter how safe the gun is, it is a felony to possess the gun. If he continues to live in the house he is at risk, even if he does not "own" the gun. If he has access to the key to the safe, he risks being charged under federal law. The smart bet is to move the gun somewhere else, because he will not want to have to explain this to a probation or police officer.
The response I have provided is general in nature, and does not create an attorney-client relationship. My practice is based in Rhode Island, and the law and practice in other states or jurisdictions may be different.
Generally, no, you cannot be in a home with a firearm if you are a felon. However, I am aware of a few instances here in Harrison County in which felons have spouses who still own firearms and keep them in their homes. In each case, the firearms are secured in a safe with fingerprint access only so the felon cannot gain access to the weapon. When in doubt, the best bet for your first step is to make inquiry to the police or a probation or parole officer. Once you have an answer, you can then investigate the alternatives.
I am only licensed in the State of West Virginia. Comments offered in my answers are intended strictly for the purpose of sharing ideas that person asking a question may want to consider. Legal advice can only be given by an attorney licensed in your state and offered in the context of the attorney client relationship. No attorney-client relationship is offered or created by my answering this question.