First, I am not giving you legal advice please see the disclaimer below this answer. I can't advise you what to do since there are too many facts in your situation I don't know. What I will say is that - in general - tenants can bring civil suits against their landlords for failing to provide habitable units. You should call an attorney. Many will give you a consultation without charge.
I am NOT giving you legal advice. Nothing stated here should be construed to establish any sort of attorney-client relationship. My opinion stated here is limited by the information available to me. You should not rely on my statements in determining your course of action.
First, you should move out before you get injured. Then yes, you can sue the landlord, for some or all of the back rent. Check with your city to see if there is a rent control board. If so, they can help. Or go see a landlord tenant attorney.
There must have been some clues that this unit wasn't legal, but let's move on from that.
I would move out, and then sue the landlord for back rent paid. A landlord may not be able to collect rent from a unit that isn't legal or has a "certificate of occupancy" issued by the city.
If therre is rent control in your city, this might put a single family house into a "duplex" catagory and bring it under their jurisdiction.
I would consult with an attorney who should review your lease and then if hired, do an investigation regarding some of the things discussed here.
This is general legal advice intended for informational purposes only and does not create and attorney/client relationship. If you wish further advice, please contact an attorney of your own choosing or you may contact me for further advice and make other arrangements including retaining my services.