Most state's do not allow landlords to evict tenants in "retaliation" for any legal action a tenant has taken, such as making a complaint. Michigan's Legal Aid indicates that an eviction in retaliation is illegal (see here). Eviction is a process that involves a notice to the tenant and then a court proceeding to either allow the landlord to evict the tenant or deny the landlord the right to evict. During such court action a tenant can raise defenses to the eviction to counter the claims of the landlord.
Michigan has several services available to renters who are having difficulties with thier landlords or facing eviction. The Michigan Tenant Counseling Program provides free servcies and information about tenant's rights here (and has offices that offer personal assistance in a couple of counties) Michigan's Legal Aid society also offers free tenant information here and here about eviction, illegal evictions, and some tenants rights as well as they can be contacted here for direct help.
JA does not provide advice, only information. You asked what your rights were, and the information provided indicates that it is illegal for a landlord to evict a tenant for retaliation (in other words, a tenant has a right to fight such an eviction) and also says that a note about an eviction is normally only the first step in an eviction. The process of eviction may begin with the notice of eviction, but there needs to be a court hearing for the court to determine if a landlord can evict. That means that a landlord cannot just lock out a tenant or put their things out. The legal process of eviction, which for Michigan is provided in the resources I provided in the above answer, provides a tenant the ability to fight that eviction. The additional information about tenant's rights and legal aid are there to offer you additional assistance to learn more about your rights and to actually speak to an attorny near you who can assist you in your personal case. There is much more here than just (go see an attorney).
What to do, of course, will vary based on whether the building is considered safe or not safe, as you indicate there are problems with it's maintenance, and also on whether the landlord is following the legal requirements of a proper eviction. The resources indicated in your first answer can help answer those questions.
DISCLAIMER: Answers from Experts on JustAnswer are not substitutes for the advice of an attorney. JustAnswer is a public forum and questions and responses are not private or confidential or protected by the attorney-client privilege. The Expert above is not your attorney, and the response above is not legal advice. You should not read this response to propose specific action or address specific circumstances, but only to give you a sense of general principles of law that might affect the situation you describe. Application of these general principles to particular circumstances must be done by a lawyer who has spoken with you in confidence, learned all relevant information, and explored various options. Before acting on these general principles, you should hire a lawyer licensed to practice law in the jurisdiction to which your question pertains.
The responses above are from individual Experts, not JustAnswer. The site and services are provided “as is”. To view the verified credential of an Expert, click on the “Verified” symbol in the Expert’s profile. This site is not for emergency questions which should be directed immediately by telephone or in-person to qualified professionals. Please carefully read the Terms of Service (last updated February 8, 2012).