Write a contract for an option to purchase property agreement

Job ID: 33103583

Budget: £20 – £250 GBP

Person A owns a property but can't take a mortgage out on it
Person B will help A get the mortgage through a commercial BTL, Joint borrower sole proprietor.
If person A fails the pay the mortgage B will have to start paying. If they have to pay for 3 months in a row they will be entitled to purchase the property for £x

I need this agreement written so that in the event B has to pay they have a legal doc which says their entitled to buy the house at x cost