He couldn't be sure.
Pretty much everything Dumbledore does, even his grand plan to best Voldemort, was based on guesses, conjectures and predictions. It all turned to be right, but it could've failed.
His body keeps her sacrifice alive, and while that enchantment
survives, so do you and so does Voldemort’s one last hope for
himself.’ Dumbledore smiled at Harry, and Harry stared at him. ‘And
you knew this? You knew – all along?’ ‘I guessed. But my guesses have,
usually, been good,’
Rowling, J.K.. Harry Potter and the Deathly Hallows (p. 580).
Pottermore Publishing. Edición de Kindle.
About the accidental creation of Horcruxes... Creating a Horcrux requires performing a spell, not only killing. You can't create a Horcrux accidentally. Killing rips the soul, but you still have to perform the spell in order to break apart your soul apart and safeguard that piece in another place.
‘Well,’ said Slughorn uncomfortably, ‘you must understand that the
soul is supposed to remain intact and whole. Splitting it is an act of
violation, it is against nature.’ ‘But how do you do it?’ ‘By an act
of evil – the supreme act of evil. By committing murder. Killing rips
the soul apart. The wizard intent upon creating a Horcrux would use
the damage to his advantage: he would encase the torn portion –’
‘Encase? But how –?’ ‘There is a spell, do not ask me, I don’t know!’
Rowling, J.K.. Harry Potter and the Half-Blood Prince . Pottermore
Publishing. Edición de Kindle.
Besides, as per Dumbledore knowledge or conjectures, the soul part that was in Harry was produced only by the rebounded Killing Curse, which teared said part from Voldemort's damaged soul. Since the rebounding of a Killing Curse is unprecedented, and never happened again, it is safe to assume that no other untintentional pieces of soul were created by Voldemort.
‘Tell him that on the night Lord Voldemort tried to kill him, when
Lily cast her own life between them as a shield, the Killing Curse
rebounded upon Lord Voldemort, and a fragment of Voldemort’s soul was
blasted apart from the whole, and latched itself on to the only living
soul left in that collapsing building.
Rowling, J.K.. Harry Potter and the Deathly Hallows (p. 560).
Pottermore Publishing. Edición de Kindle.
And even more importantly, Dumbledore couldn't have known if Voldemort changed his mind and decided to make more than seven Horcruxes. Voldemort could've created ten, twelve or even more. All he had was a conjecture based on a memory.
Wouldn’t it be better, make you stronger, to have your soul in more
pieces? I mean, for instance, isn’t seven the most powerfully magical
number, wouldn’t seven –?’
Rowling, J.K.. Harry Potter and the Half-Blood Prince . Pottermore
Publishing. Edición de Kindle.