I agree with those that have previously stated that a primary residence is a mediocre investment, but I think the original question is what is an investor's approach to primary residences.
I have devised a plan that I have yet put into action, but I believe is a solid approach to tax harvesting a primary residence equivalence. It would go something like this.
Agree with a friend that an exchange will be made. I find a suitable house for myself and loan the down payment to a friend who purchases it in their name. They then rent the property to me for a nominal amount and write off all depreciation, interest, and expenses. Similarly, they find a property for themselves and loan me the down payment, I purchase it and charge them the same rent amount. I take all write offs with the property in a similar fashion.
I am not really sure what the best exit strategy would be. Ideally the ultimate sale should take into account the $500k capital gain exclusion. Maybe 1031 exchanging it to one another, and then sell, but I'm not sure if that can work without renting it out for a period of time to someone else after the 1031 exchange.