Two major principles from Gilligan's ethics of care would apply to the situation. First, the context of the killing and second the issue of vulnerability.
In terms of context, the killing by Person A in the course of a robbery is clearly the worse deed because the motive is entirely selfish rather than relational.
On the other hand, Person B is killing someone who might be the more vulnerable.
The key piece of information that is missing though is whether this was an assisted suicide in which the loved one had requested Person B kill him/her to end suffering, in which case Person B is morally indifferent but merely acts as a tool (like a pill or a gun) used as an instrument of suicide. If the loved one wished to live, then Person B would be much more in the wrong than Person A due to the vulnerability issue. If the loved one were in a vegetative state or otherwise mentally incapacitated (advanced Alzheimer's), removing life support or euthanasia might also be justified.