Answer: Spain: 1) in the first part of the history there are various monarchies and Spain is not united, 2) unification of Spain in 1469 under the kings of Aragon and Castile, 3) Habsburgs (the first Habsburg in Spanish throne was Philip I The Fair, son of Holy Roman Emperor Maximilian I) who ruled shortly during 1506. This dynasty reigned in Spain till 1714 (death of Charles II), 3) Bourbons (from 1714 till today). France: 1) Capet dynasty (starts with Hugh Capet), 2) Valois dynasty (which is a branch of Capet dynasty, starts with Philip VI, 1328 became the king of France), 3) Bourbon dynasty (first king of this dynasty was Henri IV, 1589). 4) short perior of Napoleon dynasty (Napoleon I), 5) Bourbon dynasty again (1814/15-1830), 6) Napoleon dynasty (so-called Second Empire, 1852-1870).
Explanation: that part of history that took place before 1469 I do not consider history of Spain because there were different monarchies there. What happened before Hugh Capet (Carolingian dynasty, Merovingian dynasty) I do not consider "France" because it was "kingdom of Francs".