The source code shows that any form that keeps mutations will allow all eight rings as well. Spider is a special case as it does not keep mutations but allows 8 rings.
The non mutation forms are lich, blade hands, statue form and beastly appendage as seen in the below code snippet constants. A separate piece of code takes each piece of equipment off depending on whether its a ring at ring locations 3-8 and whether it meets keep-mutation or spider form in which case it declines to remove the ring.
Reference:
bool form_keeps_mutations(transformation_type form)
{
switch (form)
{
case TRAN_NONE:
case TRAN_BLADE_HANDS:
case TRAN_STATUE:
case TRAN_LICH:
case TRAN_APPENDAGE:
return true;
...
}
Goes to removal code snippet:
// Octopodes lose their extra ring slots (3--8) in forms that do not
// have eight limbs. Handled specially here because we do have to
// distinguish between slots the same type.
if (i >= EQ_RING_THREE && i <= EQ_RING_EIGHT
**&& !(form_keeps_mutations(form) || form == TRAN_SPIDER))**
{
result.insert(eq);
}