A legal agreement, or contract, doesn't need a template. The sole purpose of a contract is to make clear what will happen in what circumstances. If you use plain language that can't be misinterpreted, you will be fine. If you're looking for a template that gives examples of all the conditions you should remember to address, that's different. And there are dozens of examples easily searchable on the internet.