First step is apply for a non-O Visa based on marriage to a Thai national. Can be applied as an EVisa online or you can check with your local embassy. In either cases you will be required to produce a financial proof and some other paper work, pay a visit to your local embassy website first. Visa is single entry and valid for 90 days of stay.
Second step, arrive in Thailand and open a bank account, if possible with Bangkok Bank, because it has no limits to the amount of money you can transfer from abroad. Within the first 30 days of stay deposit
*****
0 baht as that is what you need to have your visa extended.
When you have 45 or less (some provinces 30) available days left go to immigration and extend the Visa for one year. Again pay a visit to your local immigration office first for the list of requirements. After that keep extending the Visa over and over every year (
*****
0 baht in bank 60 days before each re extension).
Last but not least, get as much documentation as possible about stuff like TM30, 90 days report, Re Entry permits and certificates of residence as you are going to need them all.
Chok dee