Why did you ask a second question ... please keep related questions together on a single post.
Again you file a NY return ... but are you an employee who crosses the border into MD ? Or are you self employed and have a MD client ?
As a resident of NY, ALL your income is taxable by NY, regardless of where you earn it. Thus you MUST file an NY tax return.
If you actually (physically) perform any of your work in MD, then that portion of your income is also taxable by MD, and you must file a non-resident MD return in addition to your NY return.
If you never physically work in MD, you need file only the NY return.