Hey aryan2512,
Thanks for using Apple Support Communities! I understand iTunes doesn't recognize your iPhone when connected. I am happy to help.
Take a look at the steps in the article below for how to resolve this.
If iTunes doesn't recognize your iPhone, iPad, or iPod
Also, if you've connect to your computer with this device before, it's expected that you wouldn't be prompted to 'Trust This Computer' again. Check out more on that here: About 'Trust This Computer' alert on your iPhone, iPad, or iPod touch
Thanks again, and have a great day!