1)First you have to decide what each person wants to happen if they die
For example, is the objective that the if non-resident C dies, then his share will go to Resident A and B, or whichever of them still lives there?
Or does C want their 1/4 share to be distributed to their 3 children?
2) As a general rule, keep it as simple as possible.
2A) As a general rule, it is better that the fewer owners there are, the better.
It would be disastrous if Residents A&B are living in the house in their 70s and the 3 children of C who now own 1/2th each want to sell the house.
3) So what would be a good solution?
Resident A makes a will that their share in the house goes to Resident B, but if Resident B predeceases him, his share goes to the survivors of C & D.
Resident B makes a similar will.
Non-resident C makes a will that their share goes to A and B equally or, if either has predeceased C, to the other person in full.
Non-resident D makes the same will.
4) If A and B die, while C or D is still alive, then C or D makes a new will.