We had to leave our car for 8 months and I did plenty of research on this topic. This is what I did for a 2012 Subaru Legacy with only 3,000 miles on the odometer-
1) Had the oil changed.
2) Filled up gas tank and added one can of Seafoam (Available from Walmart). Drove the car for 15 minutes.
3) Cut carpet squares and put them under the tires. (To prevent flat spotting).
4) Disconnected Battery.
5) Covered with car cover inside my garage.
The car sat for 8 months this way and after I connected the battery upon my return the car started and operated like new.
The Ethanol in the gasoline will cause issues after a while if not treated with fuel stabilizer.