I went through something like this (need for rehab, but not with the dementia added on) recently with both my mother in law and my father. To qualify for rehab they generally need to require 3 therapies, I believe, and be expected to be able to participate in therapy and improve function. Neither my MIL or father qualified for rehab (MIL with terminal cancer and broken hip, father post stroke and open heart surgery). Instead, they were approved for a lesser level of care in a skilled nursing facility, which was covered by Medicare for a period of time. In both cases, however, I had to get involved and insist that the discharge planning involve further inpatient care - both my MIL and father wanted to go home but were not able to do basics like get up and down, get to bathroom, etc.
Even at the skilled nursing facility, however, Medicare would only continue to cover the care if they were active in therapy and making progress to get discharged (there are # of day limits as well). If they are not able to meet the qualifications for coverage, then you either have to take them home or become private-pay, regardless of whether or not they are independent with their activities of daily living. My mother was not able to physically handle my father's care. It was not safe for him to remain at home, so we began talking to the social worker at the skilled nursing facility about applying for Medicaid coverage for him. My dad has 12 lives, I am convinced, and he pulled through and was able to go back home before we had to pull the trigger on that.
If you do not have a long-term care insurance policy that will cover dementia care in a skilled nursing facility, I suggest that it is time to see an elder care attorney to discuss your options and how best to protect your assets and get him the long-term care that he is going to need. This is such a tough situation, but it is too much for you to handle alone. After my father's stroke, we set up a trust and transferred their investments and many other assets to the trust. Our state has a 5 year look-back for transfer of assets and they apply various penalties for Medicaid eligibility. State rules are different. An elder law attorney will know how to best protect you both. My heart goes out to you in this difficult time.