Hi mahesh213,
For limiting 2 persons at atime you need to keep the logged in user details in database.
CREATE TABLE LoggedInDetails
(
UserId VARCHAR(50) PRIMARY KEY NOT NULL,
LastLoggedIn DATETIME NOT NULL
)
When new user tries to login in the application the you need to check the already login count.
SELECT COUNT(*) FROM LogInDetails
Then if count greater that equals to 2 then show the user a message.
When user click Logout then you need to remove the record from LoggedInDetails table so that other user will be able to log in.