Gautam this is because he smells his own urine etc. in your house. Firstly, please take him out early in the morning as soon as he opens his eyes. He must then be taken out every hour by the clock, also as soon as he wakes up and immediately after his meals. He will start doing it outside. When he does this praise him and say 'Good Dog' and make a fuss of him. When he does it inside do not shout at him, take him out immediately so that he associates this with going out for it. He will gradually increase his time to once every two hours and more. Don't give him more than 3 meals a day right now and after 5 months make it two meals a day. Always keep a bowl of fresh clean water for him to drink throughout the day. You will have to work hard but it will pay off. Wherever he urinates or defecates please wipe the spot with a solution of water and bleach. The bleach will remove the smell, but make sure your Dog does not lick it or sit on it as some Dogs like to roll on it.