Here are the three scenarios you appear to be talking about, albeit slightly reordered to collect like things together and slightly reworded to produce grammatical English and highlight differences.
Notice that everything in each sentence starting from the verb of the main clause is identical; that part is on a second line set in roman. The subject of each sentence is in italic, and the distinguishing features within it are in bold.
1. A Verb Study: The Gerund Clause as Subject
This is a verb because it takes because it takes the normal elements of a verb phrase like adverbial modifiers and object complements:
- Quickly demolishing and rebuilding their house
was the couple’s best option as this point.
Quickly is an adverb and their house is the direct object of both verbs connected by the coordinating conjunction and.
2. Another Verb Study: The Infinitive Clause as Subject
This is also a verb for the same reasons just given for the gerund:
- To quickly demolish and rebuild their house
was the couple’s best option as this point.
Here again, quickly is an adverb — and their house is the direct object of both verbs connected by the coordinating conjunction and. It needs no preposition and tolerates none.
3. A Noun Study: The Deverbal Noun as Subject
This is no longer a verb but a noun, because it takes the normal elements of a noun phrase such as articles, adjectival modifiers, and prepositional phrases:
- The quick demolishing and rebuilding of their house
was the couple’s best option as this point.
Here the is an article, quick is an adjective, and of their house is a prepositional phrase that applies to the two nouns connected by the coordinating conjunction and.
Summary
Infinitives and gerunds are still verbs, because they pass verb tests, whereas deverbal nouns fail those test but pass noun tests.
Gerunds, to-infinitives, and deverbal nouns can all serve as the sentence subject but only the first two are verbs; the third is a noun — as its name should suggest.