Get your taxes done using TurboTax

Incarceration is considered being temporarily away from home and doesn't affect your filing status.  Thus treat the time that your spouse was incarcerated as if he/she was living at home. 

The main thing that would affect your filing status is your marital status.  If you are married and want to file Married Filing Jointly (MFJ), you can.  Or you can file Married Filing Separately, but you lose various credits by filing MFS and your taxes are higher.   If you are legally separated or a divorce is final as of the last day of the tax year, you can file single, or head of household (HH) (if you qualify for HH given that you have a dependent that lived you and some other requirements).

MFJ is the most advantageous filing status from a taxing/credits/thresholds perspective.  HH is slightly less advantageous.  Single is a bit worse.  MFS is the worst in terms of tax rate and tax benefits.

There is a way of filing head of household if you are "considered unmarried," which has some rules associated with it, but in your case, a spouse being away from the home due to special circumstances doesn't qualify you for such.  Otherwise, if your spouse and you didn't live together for all of the last six months of the year, you could use HH (if you had a dependent that lived with you and you met other qualifications).