To house hack by renting the additional units of a 2-4 unit is good. However, your biggest slug of cash will come in the form of the capital gains savings, once in the house two plus years (not a tax professional, not giving tax advice).
To maximize homestead investing in this manner, you will need to achieve the biggest earnings. This translates to finding a big problem to solve, and/or finding a way to add value.
This also requires a property of large enough value to generate a big slug.
Consider living in the largest, nicest, property you can afford (with the biggest problem to solve, or most value to add). Your quality of life is better than hacking a four plex. The capital gains will be easier to document, being a single family, instead of multi.
Example: House is worth $1M ARV. You buy for $600K. Put $150K in. Own at $750. Live in it for two years. Sell at $950K. Make $200K tax free. Rinse and repeat.
The challenge is affording the two year occupancy. Imagine if you found seller financing, interest only, with a three year balloon. The scenarios are endless. The concept is homestead the luxury property, don't house hack the duplex. Both are solid plans. One has more profit and likely a pool. Enjoy.