"Buy outs" in the NHL are kind of a confusing mess. The rules are different for players oer 26 and under 26.
What I do know is this (and this counts for players who have passed the age for unrestricted free agency I believe). PlayerA has 2 years left on his contract that pays him $1 million dollars a season. TeamA buys out PlayerA. TeamA would have 2/3's of the remaining value of PlayerA's contract on their payroll for twice the amount of time remaining on PlayerA's contract.
So, TeamA would take a cap hit of $333,333.00 per year for 4 years.
The formula is:
DOLLARS PER YEAR X YEARS REMAINING ON CONTRACT X .667 = A
YEARS REMAINING ON CONTRACT X 2 = B
A / B = C
C = salary cap hit per how ever many years "B" equaled to.
Now, that is my BASIC knowledge of the "buy out" rules. I read that section of the CBA a long time ago and quickly reviewed a short article I read on the topic before I posted this....I could be wrong on my math...take it for what it is worth.