Yes, every day counts, and it counts from the very beginning regardless of where that custody happened.
This is called jail credit or presentence credit, and it is applied automatically to the sentence calculation when the judge issues the final order. Any time your person spent in custody before sentencing, whether that was in a county jail waiting for trial, held in another facility on a detainer, or even a brief hold in a different jurisdiction, all of it goes toward the total time they need to serve. A single day in custody counts as a full day of credit. An hour technically counts as a day in most jurisdictions because the calendar day is what matters, not the hours within it.
So if your person was in custody for 90 days or more before sentencing, those 90 days get subtracted from the sentence when calculating the release date. On a two year sentence with 90 days of presentence credit already banked, they are walking in the door with roughly three months already served.
The important thing is to make sure that credit was actually applied correctly in the paperwork. Errors in jail credit calculations happen more often than they should, and an inmate or their attorney should review the judgment and commitment order carefully to confirm that all days in custody are accounted for. If any time was missed or miscalculated, a motion to correct the sentence can be filed to address it. It is a straightforward fix when caught early and worth verifying before assuming the math is right.