Only non-sexually:
- Humans start using designer babies
- Mum and dad start designing their baby in a computer, the genetisist picks the correct genes and builds the embryo from the specs.
- A religion based on the power of 7 starts.
- Hopefully their planet has 7 heavenly bodies to inspire such a religion. 7 being godly comes from [Sun, Moon, Mercury, Venus, Mars, Jupiter, and Saturn] being visible in the sky. 7 Gods.
- Followers of the region decide to start reproducing in tuples of 7. They sample 7 parents DNA in order to extract the optimal genetics, using the existing designer baby process.
- There are 3 classes of females, 3 classes of males, and D is a female who can carry a baby to term.
- The classes are an arbitrary construct and not genetic. They have status within the religion (An A can only work in these professions, and F can only work in these professions, etc).
But if it must be biological?
The reasons for this are in the comments to your question.
But what if it did, what would it look like?
This is a slightly realistic process. It's still flawed, but has a decent chance of suspending disbelief in those who arearen't biologists:
- Mutations occur that aren't noticed and play no role. These create your 7 genders. 3 different types of X Chromosone (XA, XB, XC). 3 different types of Y chromosome (YE, YF, YG). And an intersex gender.
- Many generations go past, allowing the genes to distribute. No-one notices anything because the changes are subtle and non-dominant. You have Xa-X females, you have Ye-Xb males, etc.
- Eventually you start getting pairs, eg Xa-Xa females. You need the X chromosome so you'll never get males without X chromosomes. You'll have eg a Yf-Xb male, a Yf-Xa male, a Ye-Xc male, etc. These "pair matched" children have an advantage over normal children. Minor superpower sort of thing.
- Something happens to delay the internal travel of genetic material post sex. You're keeping this family friendly so not worth going into the survivability of spermoza in different environments. Basically sperm merge together: Yd and Ye combine to give the genetic advantages of each.
- You need to define a way for females to exchange genetic material that isn't lesbian porn. I have no ideas.
- When this occurs, the child has the advantages of both females X chromosomes.
- You need a way for someone with neither sex organ to contribute genetic material that isn't intersex porn. I'm even more a loss for words on how this can occur.
- A child takes the benefits of all 7 parents, one chromosome becomes dominant, giving their gender.
Yeah this process is flawed, and anyone good at biology would rip it to shreds. But it sort of loosely follows the path that would be needed, and may be suitable.