Hello, I am happy to assist you today.
You have the right to live in a safe place that has reliable gas. The landlord must have the home fully inspected and up to code in order to rent it out. Failure to do so makes him liable.
You are not obligated to pay rent if you have this type of serious problem. You can withhold it until it is fixed. You are also entitled to rent back for the time period that this has happened. You could make an offer to the landlord of how much he should pay you to settle the matter, or you could just go to court and get the judge to determine.
You are also entitled to stay somewhere else until the gas is fixed. The landlord has to give you another place to live or let you stay in a hotel and reimburse you for that. You absolutely do not have to stay somewhere that is not safe.
I would stop paying rent and send a written demand to the landlord asking for compensation for the months that you have had this problem in the amount of rent paid. Then I was ask for him to pay for a hotel until it is fixed. You can state that if not fixed within a reasonable time, let's say 1 week, then you will vacate the apartment and are cancelling the lease for his breach of contract.
You also could go to court in landlord/tenant court in your county and get a court order on this, which will take away any risk you have, but will take more time. I think you should get a hotel right away, so if you can get the landlord to pay for that it would be great.
I hope this helps,