The H. Pylori is an bacterium which causes infection in stomach. This bacterium is spread in unhygienic conditions. This can not be transmitted by contact. There is one possibility that if your boyfriend does not wash hands with soap after using toilet and he touches your food and you eat this food. This can cause H. Pylori infection in you.