All perfect praise be to Allah, The Lord of the worlds. I testify that there is none worthy of worship except Allah and that Muhammad is His slave and Messenger.
The ahaadeeth on the virtue of weeping out of fear of Allah are many; among the most authentic of them is the hadeeth narrated by Abu Hurayrah, may Allah be pleased with him, which was reported by Al-Bukhaari and Muslim, about clarifying the seven kinds of people who would be shaded under the Shade of Allah on the Day there will be no shade except His Shade, and among them is a man who remembers Allah in solitude and his eyes overflow with tears.
Also, At-Tirmithi and others reported that Ibn ‘Abbaas, may Allah be pleased with him, narrated that the Prophet said, "There are two eyes that shall not be touched by the Fire: an eye that wept out of fear of Allah, and an eye that spent the night standing on guard in the cause of Allah."
As regards whether weeping out of fear of Allah erases the past sins or the past as well as the future sins, then we have not come across any text in this regard, though weeping out of fear of Allah may indicate sincere repentance, and sincere repentance erases all past sins.
A person who sincerely repents from his sins is like the one who has no sins, as was narrated by Ibn Maajah from the Prophet .
Allah knows best.