There are some standard rules such as no openings greater than 4” but there are other less obvious rules you need to be aware of. Ultimately the rules are there for your safety and the safety of anyone who may use your deck. No railing should be designed in a manner that will allow it to be climbed. Another rule is that bench seats need to have a 36” high seat back that prevents someone from falling over the back. If this seat is over 60” from the ground the seat back needs to be 42” high. I recommend getting a permit from the city so you can view all the code regulations. Make sure that the railing is properly attached to the deck surface and the house if possible. A loose railing is just as dangerous as one that has over 4” openings.