Wow, this is going to be complicated! If it were me, I would want to keep the ownership separate from the rental. So, for your brother's payments for renting the room, I'd come up with a fair rent number. Rent would go into the partnership to pay expenses (mortgage, insurance, property tax, HOA). As a renter, he would be responsible for electricity, etc., with the roommate. If rent from both rooms is not covering the partnership expenses, then you have to decide who pays in more and how that affects distributions of profits.
On the framework you outlined, in considering how proceeds are allocated upon a sale, I'd also consider what happens if the sale price is below purchase price. Let's assume the purchase price is $100; that you each put $10 down; and there was an initial mortgage for $80. Five years down the road, your brother has paid off $15 of the mortgage and $65 remains.
If the house is sold and for less than $65, who is going to have to come out of pocket to pay off the remaining balance on the mortgage?
If the house is sold and for $75, who gets the $10? Does your brother get it as a partial return of his principal payments? if so, do you owe him anything for the principal payments that he didn't get reimbursed?