According to code, rails must be installed on stairs with more than three risers. Local code may differ. We have an entire post on the subject here: https://upsidebycolorguard.com/do-i-need-a-deck-rail/