I had a inguinal hernia for 2 years and when I first discovered the hernia I was having back problems. Can the inguinal hernia cause the back pain.

Typically not. Inguinal hernias will typically cause pain in the inguinal region with possible radiation into the testicle on the affected side. To put any stress on the lower back, a hernia would have to become large enough to affect the posture. This would be unlikely in someone your age.
Probably not. I suspect the two conditions were unrelated, but simultaneous.