Oftentimes the last month's rent is "used up" in the last month. if the landlord still holds it, and if you paid for it, you may be entitled to all or half. The same applies to the security deposit.
It's a bit hard to tell absent more details. You should make a quick call to a local attorney for assistance. There should be no need to give up on the money.
I am not your attorney and am therefore giving only general advice. DO NOT rely on this advice to make your decisions. Please see a local attorney, licensed in your state, for further advice.
If you are not renewing the lease, you should make sure the landlord knows this and that you will be out by the end of the lease, or are already out. Last month's rent is often applied to the last month, so there will not be any refund on it from the landlord. Who gets the security deposit can be tricky. Since you paid it, arguably it should go to you, but the landlord may make the payment directly to both and you will have to address this with your ex.
There are many laws related to last month's rent and the security deposit you may want to have the lease and everything looked at.
DISCLAIMER: This answer is provided in response to a "hypothetical" question and provided for general, informational purposes and does not create an attorney/client relationship. The information presented is not legal advice and may change based additional information and research. It is recommended that you speak to an attorney to discuss your specific legal issues.
I'm glad to hear that you have removed yourself from the abusive household.
If your co-tenant has been paying your share of the rent in your absence, he will certainly argue that any money held by the landlord should be returned to him and him alone since you abandoned your obligations to him and the landlord.
If neither you nor your boyfriend has been paying your portion of the total rent obligation, then I'm afraid the landlord will have used up your last month's rent and security deposit to satisfy unpaid rent.
There is no harm in asking your landlord to return the money. Good luck, and be safe!