Whoever denies the Son, the same doesn't have the Father. He who confesses the Son has the Father also.
The second part of the verse is the positive corollary to the first part. Confessing the Son is the opposite of denying Him. Confessing the Son results in the Father abiding in the confessor. Confessing the Son involves a public profession of faith in Him, not just exercising saving faith in Him (cf. Romans 10:9-10; 2 Corinthians 4:13). Belief in the heart results in imputed righteousness, and confessing with the mouth results in salvation (lit. deliverance, namely, from the consequences of being a secret, non-confessing, believer). A non-abiding Christian might not confess Christ even though he or she believes in Him. Both denying Christ and confessing Christ deal with giving personal testimony to one’s faith in Him; they do not determine salvation. Thus denying Christ cannot result in the loss of eternal salvation nor can confessing Him obtain it. If John meant that no genuine Christian can deny the Son, the corollary is that every genuine Christian must confess the Son. That would make public confession of Christ a condition for salvation in addition to trusting in Him, but this lacks biblical support.