You cant prevent it.
You can however reduce it by pointing the guitar mic down at the guitar and away from your (the singers) head.
Vice versa for the vox mic. Point it away from the guitars body and up toward the vocalists mouth.
Also, hypercardioid pattern mic(s) will aid in your goal as well.
They have better rejection at the back and sides than standard cardioid mics do.