The proper way to measure this is to measure the time span between when a player first achieved the #1 ranking and last achieved it. For Nadal it's 11 and a half years which is, of course, very impressive.
The fact that Nadal has held the #1 in three different decades is an arbitrary statistic, which he only holds because he first achieved the #1 ranking at the tail end of one decade (2008) and last achieved it at the beginning of another (early 2020). The time span between Federer's first and last #1 stints is 14 and a bit years, nearly 3 years more than Nadal's, and yet he hasn't been #1 in three different decades because his first #1 stint was at the beginning of a decade (2004). Had the calendar shifted back 2 years, Federer would have "achieved" this record and Nadal wouldn't have.
So no, this is merely an arbitrary and skewed representation of an actual record -- the longest time span between first and last stints at #1 -- that Nadal doesn't even hold. Nadal is the #2 in this category which, as I say, is a great achievement, but it can't be the "greatest record in tennis history" if it's not even a proper record.