Do American English speakers use 'in' with words as church, prison, school, hospital, university, college, etc when these words are used in their usual meaning? Do you use 'a' or 'the'?

He is in school. (Enrolled as a student)

He is at school.(For some different reasons)

He is in hospital.(As a patient)

He is at hospital.(Visiting somebody)

He is in church.(To pray)

He is at church.(For some different reasons)

He is in university/college/prison/
He is at university/college/prison/
As far as I know there is no general rule that you can use as a guide in these cases. Whether we say "at" or "in" and whether an article is used depends on both the context and on the meaning (or nuance, if you prefer) that the speaker intends to convey.
Students: Are you brave enough to let our tutors analyse your pronunciation?
Do these sentences seem to be correct to you? Don't they still need some corrections?

I can envision a situation where each of your sentences would be appropriate, except for the following:
He is at prison. He is at the prison.
He is at university He is at the university.
He is at hospital. He is at the hospital.