Orders always get executed in price, time priority meaning, if its a buy order, orders having the highest bid gets executed first and if its a sell order, orders having the least offer get priority in execution.
In case 2 orders with the same price enter the system, then the order first received gets priority.
Trades get executed when the bid and the offer match. I don’t think its possible to ensure that your order gets executed first or gets executed at the market opening.