What screws should I use for my floating Ikea bookshelf?
Did they have chalk when you went to school?  Soak newspaper in diluted Elmers glue, wrap it around a stick of chalk, let it dry, that's pretty much what drywall is.  You wouldn't expect that to carry a load, would you? 

Your wall probably has wood or metal studs typically 16" on center, sometimes 24",  unless it covers concrete or cinder block.  Of course the IKEA product is metric, so we can't expect it to line up with 16/24" centers unless they were rather clever. 

The UPPER holes nearest the poles do 90% of the weight carrying.  Either one will do.  The lower holes just keep the unit from flopping upwards. Can't hurt, won't help much. 

So find your studs in the walls and figure out how to position the Ikea unit to get the best weight transfer onto the studs. Ideally position it so both outer poles are well supported near studs. Feel free to drill extra holes in the IKEA mounting bracket, again the upper holes are the ones doing all the work.  You are drilling into steel, "feeds and speeds" matter, feed is downforce (roughly) and speed is drill speed. When you're in the sweetspot, the drilling is fast and the chips are long. 

If you just can't make things line up the way you want, another option is get a piece of hardwood 1" thick (preferably 1.5") and the size of the backing plate.  Position it exactly where you want, attach the hardwood to every stud it overlaps, then attach the IKEA mounting bracket to the hardwood as instructions direct but with 1-1/4" screws.  The trick to working with hardwood is pre-drill every hole so it doesn't crack the wood, and drill a slight countersink for the screws into the wall so the Ikea backplate doesn't ride up on their heads. Bonus points if you drill extra holes in the Ikea backplate and run them straight into the stud as well. 

Never drill more than 1-3/4" below the wall's surface.  The standard for construction is that wires and pipes must be at least that far away from the wall surface or be guarded by a metal plate to make them difficult to drill through.  If you carelessly use 3" screws and nick a wire, it can break wires or pipes - even electrify the entire shelf!