Look at your statements or online activity and see when the dividends and capital gains were paid out. Include them on the state return for whichever state you were living at the time they were paid.
**Say "Thanks" by clicking the thumb icon in a post. **Mark the post that answers your question by clicking on "Mark as Best Answer"