Other than attending classes and meetings, faculty differ in their daily attendance. Some faculty may show up only during days they have classes, others are in their offices daily from 8-5, others arrive around noon and stay late. Are their any rules or it is up to each department or faculty?
It varies very widely depending on individual faculty, departmental, and institutional culture, norms, and rules.
For example, many faculty at my institution live in a city two hours away and only come to campus twice a week for classes and meetings. Faculty performance at my school is measured by lines on the CV, so one can argue that not going to school is a more productive use of time if you have a home office.
Meanwhile, while in Japan, I noted that some faculty had to punch timecards that showed their daily attendance. There, faculty performance seemed to be measured by the appearance if diligence rather than actual productivity.
On the extreme other end, adjunct faculty in the USA may not even have an office (or library privileges) to even have office hours.
I think you answered your own question. It's up to the department and school. Office hours are usually mandatory for many schools, but these might only constitute an hour a week, and the door might not always be open. If you're curious about your own school's faculty, I suggest e-mailing the department head or checking the class syllabi.