Certified GKH Gardening Expert
This will be a complicated task that will require some bonsai work.
You can do some preparation, as long as the tree is still very small. You will have to treat it as a bonsai, and it won't fruit to its potential, although it may stay alive for several years. Just make sure to follow proper bonsai technique.
This collection of articles will help: https://www.gardeningknowhow.com/houseplants/bonsai