Im not sure this is the exact solution in your case. It sounds more like you are looking for labor, rather than a contributor.
I don't have answers around ownership/legal. In short, the idea should be that the project's owner is also the sole legal owner. If you write code for someone else's project, you don't sudden get a stake in the project.
Definitely something to work through.