If I only have one tab open in Firefox and I close that tab Firefox exits.
How do I disable this behaviour?
A solution that prevents me to from closing the last tab or opens a new empty tab (or my homepage) is equally acceptable.
You could also add an extension like Tab Mix Plus.
Here's a screenshot of the config page. You can do one of two things:
there's an about:config tweak that should do this: