There does not seem to be an official rule. The orthographic conferences tried to define some things with the letter and how it should be written (over hundred years ago, the single letter did not exist), but it seems there is nothing official left today. There are definitions how the letter(s) should be written, but they are only defined for a single font, e.g. for Antiqua, which is the base of many other types. Other typographists came up with other forms of the letter. The Grimms wanted to have a letter/ligature, but just used the letters sz instead.
Since the Eszett (note that you're not supposed to eat this (; ) evolved, as can be clearly seen from your picture, from a ligature of the letters ss/sz (long s with round s, or long s with z (z with Unterschlinge), it is in typography typically created as such. The modern form is no longer a ligature, but a distinct letter, with a typical form that is somehow similar to the Greek Beta. There does not seem to be an official rule. ISO/IEC 10646 / Unicode defines a form of the letter (and also for the upper-case Eszett), though the glyphs are not normative.
According to Wikipedia, where your image is from, the non-ligature letter is the Sulzbacher Form and is very common in most modern fonts, but a lot of fonts (especially those not made for long texts, but rather for signs) use one of the ligatures. I think that is similar to the usage of the ampersand. Many clear fonts use a simplistic ampersand, but some of the more beautiful fonts use the Et-ligature (et is Latin for and, and also French). I don't have a Duden handy, but I don't think I've ever seen something about the letter in it.
The picture also misses several variants, like the typical sz-ligature found on street signs:

(also from Wikimedia. Note that the second sign shows the tz-ligature, which is rare today).