rbynaker
Level 14

TheTaxBook (and I'm sure QuickFinder too) has an excellent chart with lots of different scenarios.  If you don't already have one, it's the best tax season investment you can make (it makes more headaches go away than a Costco sized bottle of aspirin.)

IMO you have to attack these from two directions.  1) What's the right (legal) tax result.  2) What do you need to document for Due Diligence.  Sometimes there's even overlap between the two.  In complicated situations, I would walk through each step and document what questions you asked, what the responses were, and the conclusion as to whether the test was satisfied.