Have you tried using the documentation. It's not there for you to ignore whilst you post questions on here.
I put "shouldAutorotateToInterfaceOrientation" into the search box and the top page returned was titled "Autorotating views". Have you tried, you know, reading it?
You should probably take the time to learn the language then, rather than just trying to copy and paste code. I don't mean to sound harsh, but if you need someone to tell you where to place some code then you don't know the language and ultimately you'll produce poor software.
I'm not even attempting to write an iPhone application until I feel like I have a good strong grasp of Objective-C and the Cocoa APIs and I have the advantage of knowing C already.