I've worked in an old style prison, built in "star shape" (it doesn't look like that any more, modernised now a lot).
Inside only livelongs or at least with more than 4 years (plus some dozens of "security guarded = livelong prisoners, who are released but have to stay under custody by court order, a "German speciality").
Usuall two share one room of at least 16 m².
They are inside their rooms at special times - or by disciplinary order (prison directors must have judge qualifications, their deputies as well).
Prisons here are thought to be the place for educating imprisoned for a life without crime - besides, of course, for 'punishing' them.
Interestingly re your link above, the Hamburg prison "Santa Fu" is known to be the worst in Germany - re staff and imprisoned.
LINK to the prison, I worked in. (Well, it doesn't say much, just the pic and lots of general information about our state's law system)