If you are not sure exactly of how Offside is determined this is a great video. It explains the Offside rule really well.