I won't paste the full limitations on Retained Salary Transactions (you can check them in the CBA in 50.5 (e) (iii) (C) if you want to read legalese), but they boil down to:
•You can keep up to 50% of the cap and salary commitment to a player you trade.
•You can only have such commitments to three players at any given time. (e.g. Toronto currently has that with Ben Scrivens, Matthew Lombardi, and Matt Frattin. They can't add another until one of those contracts run out.)
•The total of your "retained salary" commitments cannot exceed 15% of the cap's upper limit. (So under the current $64.3 million cap, a team can retain up to $9.6 million.)
•You cannot reacquire such a player for one year after the trade -- unless his contract has expired in the meantime (i.e., he became a free agent, signed a new deal, and you traded for him).
•Any single player contract cannot be used in a "retained salary transaction" (trade) like this more than twice. (So if L.A. had agreed to retain some of Scrivens' salary when dealing him to Edmonton, the Oilers could not do the same if they traded him on this contract.)