Buying in joint names will wipe out the opportunity to buy a second home under the first home grant scheme. (This is my recollection from a few years ago when someone else did this)
If you were to buy one house in your name, you'd get the grant. Later, if your friend got the second house, he/she would get the grant.
Imagine if you bought the house as a company (I doubt a company would get the grant). Your friend could buy shares in that company and hence fund 1/2 the house and be 1/2 owner.
Later, his company (another company) could buy a house and you buy shares in that house and be 1/2 owner.
I doubt that it would be approved, however the point I'm making is this:
"Look outside the square. Thinking logic will produce logic"
Good luck Des