Voldemort intentionally made six Horcruxes, but when he used Avada Kedavra on Harry, he unintentionally created a seventh Horcrux. Instead of dying, Lily's love for Harry created a counter 'curse' known as Sacrificial Protection and saved Harry.