Was the building their residence ?

They primarily residence was the Ducal Palace of Modena until 1860 when the Italian unification happened.

This building was once Villa Aufschneiter. It's in in the town of Gries. Gries is located about 50 kilometres south of the Austrian border. Today it is a suburb to the northwest of the city of Bolzano. Until 1919 this area of Italy was part of Austria.
In September 1848 Duchess Adelgunde, wife of Duke Francis V, arrived in Gries. She and her husband had left Modena in March on account of the revolution. Francis V returned to Modena in August but it was decided that if was safer for Adelgunde to wait longer. In Gries she lived at the Villa Aufschneiter which was a luxury hotel at the time. On October 19, 1848, Duchess Adelgunde gave birth to her only child, Princess Anna of Modena, at the villa. Anna was baptised there privately the next day.
Francis visited his wife and daughter at the villa several times. At the end of May 1849 Adelgunde and Anna left Gries and returned to Modena.
Villa Aufschneiter is now a geriatric hospital "Casa di Cura Grieserhof" operated by the Sisters of the Third Order of Saint Francis.

This is the street front facade of Palais Modena which was formerly located at Bveatrixgasse 29 in Vienna. The gardens of the palace are today the Modenapark.
In 1806 the palace was acquired by the grandmother of Duke Francis V, Duchess Maria Beatrice Riccarda of Modena (after whom the street Beatrixgasse is named). She was also the mother-in-law of Austrian Emperor Francis II by his third marriage. It was Francis V's main residence from 1860 until his death in 1875 when the palace was inherited by Archduke Franz Ferdinand of Austria. Francis V's widow Adelgunde continued to have residency rights in the palace, but she generally preferred to live in her native Bavaria. The palace was demolished in 1916.