Mercury is considered a metal though it is liquid at room temperature because mercury has all the other properties of a metal except being in liquid state under normal conditions of temperature and pressure.
There are other properties that qualify an element to be called a metal apart from the physical state they exist in at normal temperature. And also mercury has all the free electrons that a metal has.