Kidney basically maintains the homeostasis through excretion of waste material it maintains the acid base balance by excreting hydrogen ions into the urine and then reabsorb bicarbonate from the urine. Whereas, lungs by maintaining the rate of breathing balances the acid base balance, as the amount of CO2 depends upon how quickly you allow more CO2 to pass from the bloodstream into the air and hence lower the level of CO2 in the blood.