I'm wondering once you paid your mortgage for long enough so you own more than 50% of your home equity the bank shouldn't be able to foreclose the house anymore since you got more than 50% of the voting right. Is it the way things work ?
No that is not the way it works. As long as you owe them a single cent, if you are not paying as agreed, they can foreclose. It is up to you to find a way to pay what you own in other ways (for example, a HELOC).
They will only get what you still owe them after the foreclosure sale and the remaining money is yours, but that does probably little good for you.
When you buy a house, even if you use a mortgage, you own the whole house. You just also have a large debt which is secured on the house.
This means that you have agreed with the mortgage company that if you fail to pay the debt, they can seize your house and sell it to satisfy the debt.
Hence the relative value of the house to the mortgage is not relevant to the right to foreclose.