If we love Jesus but get it wrong it does not mean we don't love him.
What is love. I have copied and pasted the following as it describes it better than I can.
There is also an interesting contrast when you look at the Greek words for “love” used in
John 21:15–17. When Jesus asked Peter, “Do you love me?” in
John 21:15–16, He used the Greek word
agape, which refers to unconditional love. Both times, Peter responded with “Yes, Lord; you know that I love you,” using the Greek word
phileo, which refers more to a brotherly/friendship type of love. It seems that Jesus is trying to get Peter to understand that he must love Jesus unconditionally in order to be the leader God is calling him to be. The third time Jesus asks, “Do you love me?” in
John 21:17, He uses the word
phileo, and Peter again responds with “Lord, you know everything; you know that I love you,” again using
phileo. The point in the different Greek words for “love” seems to be that Jesus was stretching Peter to move him from
phileo love to
agape love.
Notice moving from a friendship love to unconditional love.
The first 2 times Jesus asks him the question and Peter says yes Jesus then replies with "Feed my lambs, tend my sheep"
So to me love is an unconditional acceptance of others, it's doing unto others as you would have them do to you (please not that I'm not saying that if someone continually beats up on you or abuses you that you have accept that)
I don't think it's that we have to show God we love him by keeping his commands, we keep his commands because we love. We love because he first loved us.