1 (before anything else) antes que nada; en primer lugar; primero firstly, we must stop the bleeding antes que nada or en primer lugar or primero tenemos que cortar la hemorragia
I must firstly thank everyone who helped
2 (on the first occasion) primero we went there firstly as tourists, then bought a house there fuimos allí primero como turistas, luego nos compramos una casa
he travelled the country firstly as a book salesman, later as a journalist
3 (in the first place) en primer lugar firstly, it's too small and secondly, it's too expensive en primer lugar, es demasiado pequeño y en segundo lugar, es demasiado caro