*feminine nouns may be declined as if they were masculine, so they can take "en" in place of "ei".

Endings are also gender dependent.

The gender a noun is assigned is quite arbitrary, and will have to be memorised with each noun. It does not match up with biological gender, and the only rules that exists are for certain categories of loanwords.