So for the past 2 1/2 years while working in a law firm, I would enter my boss's office on a daily basis and say, "Hello or Good Morning" only to be stared at (like a deer in the head lights)and ignored. I guess in my simple mind, I thought that this was the proper thing to do--Smile and greet your boss. I wasn't really looking for any acknowledgement, but it would have been nice to hear "Hello or Good Morning" as well once in awhile. Not sure what I am doing wrong. It is and has been my belief that my boss does not like me.
It's certainly courteous to greet your boss when you meet them in the morning, but depending on the cultural norm where you work, it may not be typical to enter their office to do so.
In the US, for example, I wouldn't disturb my boss in his office in the morning.
Your boss's response after the first few days you did this should have been a clue it wasn't as appreciated as much as you expected. I'm surprised you stuck with it for two and a half years.
Some people are morning people. Some people are best in the afternoon. Some people are weird and are best in the night.
Your boss is probably an afternoon person. So do not take it personally.
Different people, different offices, different habits/customs. I know people who firmly believe no morning can ever be called good if they're awake ... and I know people who would simply be amazed that you went out of your way to be polite to the boss. Luckily I've never known anyone who would be offended by a Lowly Peon daring to intrude upon the boss's attention.
You're not doung anything wrong; at most unexpected. Don't worry about it until/unless there's a complaint.
But also, you need to accept that some people don't see the point in responding to ritual greetings. It doesn't mean they're annoyed, just that it isn't their style. You need to decide whether to continue while knowing you won't be answered, or stop if the lack of answer bothers you.
Remember, if this is the thing you consider worth asking for advice on, that implies your job is pretty darned good in all other ways. Relax and focus on something more productive.