Both examples you give are legit and both are commonly used.
Any German infinitive can be substantized and receive all traits of a substantive. A prominent example might be the translation of Hamlet's to be or not to be to
Sein oder Nichtsein, das ist hier die Frage
Irren ist menschlich
the translation of the Latin "errare humanum est"
Note, in substantive use, the infinitives start with an upper-case letter, and can also carry an article. Note because the infinitive is used as a substantive, there's no additional commas involved - The comma in your first example is wrong.
[Das] Wohnen auf dem Land ist ...
Your other example uses an Infinitivsatz that can act as a subject or object in a sentence. Infinitivsätze always use the conjunction "zu" with the infinitive.
Auf dem Land zu wohnen[,] ist ...
Note this is no substantival use (the whole subclause forms the subject of the sentence) and thus the infinitive starts with a lower case letter. The comma used to be mandatory, but became optional with the latest changes in German grammar.