https://www.medicaidplanningassistance.org/medicaid-spend-down/
Basically one spouse has to spend down asset and income until it reaches an exemption amount. For example primary resident is exempt becaue the healthy spouse needs somewhere to live. Details see above.
Before the asset/income reaches the exemption amount, you spend your own money for nurse/nursing home. After reaching the exempt amount you can enroll in medicaid and live in nursing home for free.