Landlord Tenant law is so detail oriented and specific to the area in which you live it would being your best interest to consult with ad attorney in your area on the subject.  But I can say that generally, is that if a place is illegal the landlord is not entitled to collect or request ANY rent from a party.  The law does not allow a party to benefit from their illegal activity and renting a home that is not permitted to exist on the land is benefiting as I see it.  As for being able to recoup the money for the last 7 years: maybe, maybe not.  That again all depends on the law in your particular area of California.Your best bet is to seek help from an  ttorney and the courts in your area.  Be aware that if you decide to challenge the issue of illegality you may be out of a home.