How to Catch Deoxys?

The only way to have a legit Deoxys is to encounter him because of some event that Nintendo released. These events no longer happen, so you are going to have to use some sort of device that allows you to put in codes.