In 2016 I was part time resident in Maryland, where I sold my investment property with a gain. I now have to make an Amendment to modify the date I moved out of MD to Florida. Surprisingly I found that my Maryland tax does not get recalculated, no matter which dates I put in, which is wrong! The capital gains income has to split between the two states based on the time you live in those states.
Most states do not proportionally allocate based on date...Most state's Part-Year tax returns require you to step thru the entire part-year tax return to "allocate" how much of the year's federal income belongs to that particular state.
Naturally the respective states want to know what date you moved in...or out (should they ever decide to audit your income "claims" ), but you have to run thru the entire part-year interview for that state to do the allocations.
An example for one of my NC tax returns is shown below...MD should be somewhat similar, but I can't know exactly what they display for MD.
@yfmega BUT ! !......I was so focused on the details of the income allocation procedure, I wasn't even thinking of what you were selling.
As real property located in MD (i.e., not an intangible, like a stock or bond), it doesn't matter where you were living at the time you sold it. Any gain on that MD investment property would be subject to MD taxes no matter where you lived at the time of sale. (assuming you really are talking about a physical property, like a building, business, or real estate )