The "code" is another name for "law", which means that the building MUST (required) meet certain laws (codes). For this particular case, an occupancy code is stating that only a certain amount of people may be in the building at any one time. Example: no more than 30 people may be in the building at one time.
This is in case of a fire in the building.