A bunch of different systems. The most common (IIRC) was to date stuff by the reign of the current king – so ‘this is the third year of king X’ – but it could also be counted from the founding of the main city (like Rome did) or pretty much any big event.
And yes, this makes trying to date stuff that happened in ancient times a pain in the arse that involves a lot of cross-referencing to try and figure out roughly when the third year of king X was. Most of the time when you get an event being listed as taking place in suchandsuch BC there’s a bit of wriggle room on the number.
Latest Answers