Ago means back in time from now. Two years ago, a long time ago, not long ago.
It comes after the period, never before: two years ago, not ago two years — which is the opposite of nearly every other language's word for the same idea and catches out most learners. It is used with the past simple and not with the present perfect: I saw her three days ago, not I have seen her three days ago. Note long ago; and that ago and gone are the same word, which is why it works.
1adverbagoBack in time from now.
“My grandparents moved to this town fifty years ago.”
ago is a reference backward in time.
Old English agan meant to pass away or go by. Ago is its past participle, so two years ago means two years gone — and the word order that puzzles learners is simply the participle sitting where a participle goes.
Middle English
agon
English, today
ago
Built from
From Middle English agon. From Middle English ago, agon (“passed”), past participle of agon (“to depart, escape, pass”), from Old English āgān (“to go away, pass away, go forth, come to pass”), from Proto-Germanic uz- (“out”), gāną (“to go”), equivalent to a + gone, and by surface analysis, a- + go. Cognate with German ergehen (“to come to pass, fare, go forth”). Compare also Old Saxon āgangan (“to go or pass by”), Gothic 𐌿𐍃𐌲𐌰𐌲𐌲𐌰𐌽 (“to go forth”).
Etymology from Wiktionary, CC BY-SA