5 at school

a) in the school building: I can get some work done while the kids are at school.

b) British English attending a school, rather than being at college or university or having a job: We've got two children at school, and one at university.

6 in school

a) in the school building: Sandra's not in school today.

b) American English attending a school or university rather than having a job: Are your boys still in school?

When I was in high school I learned that when we talked about "time at school", we do not need to put any articles in front of "school" and when it is put, the meaning of "school" is the building itself but Longman dictionary says with or without "a", "school" means both.

Okay, then can I apply this rule to "church" but it also says there is a meaning difference between "in church" and in a church"

I am really confused now, so "in school" and "at school" can mean both "time at school" and "inside the school building", but "at church" just means "the religious ceremonies in a church"?

Please help me again.