Given the fact that Emily is known to have gone shopping for rat poison, and Homer's body (or what remained of it was found in her bed along with a length of her hair (grey, indicating that she had been sleeping with the corpse even after she grew old) it seems clear that Homer had, for some reason, decided to leave Emily. Emily did not want that to happen, so she took matters into her own hands in a sort of "if i can't have you nobody can" psychotic manner. It did not matter to her if he was living or dead as long as he stayed with her. The room itself was arrayed in an almost bridal suite fashion. On the table were the monogrammed items she had purchesd for him very shortly, it would seem, before she killed him. In her mind, she was sleeping with her husband.
Even before Emily net Homer, she had an interesting and not altogether healthy relationship with her father. She was very attached to her father and refused to believe that he was dead when he passed away. It is clear from this that Emily needed a man in order to make her feel complete, and she was willing to hold on to one even after his death.
Emily was at a disadvantage because her father was very controlling. He did not think any of the men who can calling for her were good enough for her. The irony is that, based on her appearance in her older years, she was not all that attractive which means that her options were limited. She also had a family history of mental instability. It may be that Homer, at first, thought that she was worth dating (especially as she was wealthy and he was a common laborer) but came to the realization that Emily was not entirely sane. When he wanted to end the relationship, or when Emily believed in her mind that he was going to break things off with her, she killed him to keep that from happening. The thing we don;t really know is whether or not he would have left had she not killed him. It is clear that residents of the town and even her own cousins feel that she is lowering herself by seeing Homer, but they meddle into her affairs truing to get her to marry him (and be an honest woman) or to end her illicit affair. Homer is gone for a while, and it is unclear as to whether he left to allow Emily to sort out her family involvement or if he felt pressured. In any case, she purchases the arsenic and takes the choice away from him, taking control.