Sure you can do it.
I'm not a lawyer, so this isn't legal advice. For legal advice, contact a lawyer. However . . .
To avoid any "misunderstandings" or issues in the future, it'd be advisable for you to have some sort of paperwork at the inception. Not sure if something along the lines of a rental agreement (making clear that any money paid is for rent) or something specifically stating that your partner is not acquiring an equitable interest in the property . . . almost like a pre-nup . . . is preferable.
Check with a lawyer to see what the best document would be. Other than that, though, what you're trying to do is not only possible but advisable.
Hope that helps. - Earlier today