In fact, the rules are such that, in a clear sense, particles of a specific type have to be precisely identical not just, say, extremely closely identical. This applies to all electrons, and it applies to all photons. But, as it turns out, all electrons are identical with one another in a different way from the way in which all photons are identical! The difference lies in the fact that electrons are fermions whereas photons are bosons. These two general kinds of particles have to be treated rather differently from one another.