Typically, pain in the lower back that is associated with kidney problems (infection, stone, etc) will be higher up, near the bottom of your rib cage, and in the flank area (the side of your abdomen, what I call my love handles, near there).
If the pain is from the kidneys, there are usually other symptoms that occur, including changes in urination, whether it is color of your urine, odor, frequency, lack of urination for a long period of time, swelling in your legs, fever, nausea, and/or vomiting. It is usually the location of the pain that is a good indicator of where it is coming from.
Most people don't realize that the kidneys are pretty high up on the back, almost under the rib cage, and a good test is to have someone tap on that area of your back to see if you have any pain.
Pain associated with a muscle sprain or lower back problem would also be distinct because you can usually reproduce it. Meaning, if you move into a certain position, you can cause the pain to increase or decrease. Kidney pain is more constant and wouldn't usually be affected by position changes, not always, but most of the time. Also, as I stated above, pain from the kidneys is almost always associated with other symptoms, most commonly, changes in urination, fever and nausea.
Only a urinalysis and other lab tests can tell you for sure if you have a problem with your kidneys, so if you have urinary changes, fever, nausea, or related symptoms, it is always best to present to your doctor for testing. Although I can provide you with common symptoms associated with both possibilities (kidney and sprain related), I can not give you medical advice about your specific condition or suggest a diagnosis. I can provide you with any information about these conditions that you may need to make an informed decision about whether or not you should see your doctor, but cannot make recommendations specific to your health condition.
This information is for educational purposes and does not replace a good physical from your doctor about the condition. Without physically evaluating a patient, a diagnosis can not be given.