First check it out you have the latest App of Whatsapp on your device
*.Then go to Settings > Display > Screen Timeout. This option may be different on your phone. But, you have to select the “Screen turns off automatically” option.
*.Now choose “Never” option.
*.Now your mobile screen will never go to sleep, unless you press the lock button.
*.Then switch on the Data network or WiFi as per your need.
*.Then, go to the Whatsapp Application.
*.Now your number stays online.
*.Just leave your mobile in this way. Don’t close the app. Your screen stays on, then your “Last Seen” and also stays online