When are local licenses assigned?
Solution 1:
SCENARIO 1:
The license is given at time of download to the system with the system license meaning that any user who plays on xbox live has access to the license on that particular machine. Then if you go to Console B and sign in, users playing on Console A would have the DLC and you would be using a "local" or what I would consider to be a "Roaming" license to play the same DLC on Console B. Just because you redownload on B does not invalidate DLC on A.
Scenario 2:
As Dominik said it would be assigned to the first console that connected with your Gamertag.
To my knowledge there is no method of associating a gamertag with a "Home" xbox. I will usually go reverify all licenses are owned by my personal main xbox by performing a license transfer. There used to be a method of doing it in the xbox website but has since be removed.
EDIT: This Answers are for the Xbox 360 not the Xbox One. Xbox one allows the same system and profile license and even identifies "Home" Xbox's. More info can be found at Xbox's website and even allows Sharing.