State tax filing

Sorry, if you wouldn't mind a few follow up questions, I'd greatly appreciate it?

- Does what you said above apply for dividend/capital gains income as well?
- Hypothetically, if I spent half of my time in MD and half of my time in NYC, how would I determine how much of my wages were Maryland source? Is it just dividing the taxable income by whatever percentage of time I spent in Maryland?

Thanks so much!