You will need to file tax returns for both MD and IL as a non resident and then a PA resident return.
PA and MD have a reciprocal agreement, so you should get a refund of what you paid to MD. You will need to enter that you have no MD income.
For IL, they do not have a reciprocal agreement with PA, so you will need to file a IL Non resident return first, then you can take a credit on the PA return for taxes paid to IL.
**Say "Thanks" by clicking the thumb icon in a post
**Mark the post that answers your question by clicking on "Mark as Best Answer"