The way Medicaid works is they'll pay for a nursing home once you run out of money. They also can claw back some related person gifts (or other transactions) that happened within the past few years.
If you have a lot of assets you want to pass to your heirs, but not enough assets you don't mind selling to pay for your end of life care, it's best to give to your heirs over the course of your life.
The downside is a substantial gift while the giver is alive has a paperwork burden, as well as a loss in the step-up in cost basis you get when giving after death. The upside is you get to see how your heirs use the gift and you can express your feelings directly, rather than through rolling in your grave.