Retaliatory eviction is illegal. If your rent is current and you are otherwise in compliance with the lease, it is illegal for the landlord to evict you for exercising your rights under the lease and/or under landlord-tenant law, including the right to a reasonably safe rental unit and common areas.
Depending on where you live, if you are month-to-month the landlord in general can terminate your tenancy with 20 days’ notice. But, again, this is illegal if it is retaliation.
If the landlord seeks to evict you or raise your rent (without an economic justification) within 90 days of you asserting your rights, this is legally presumed to be retaliatory, so long as rent is current and you are in compliance with the lease terms.