How to start a generator from a relay
According to the schematic.



The unit is OFF, when IG and B are connected. To start the unit, connect ST and BAT. Once it's running, none of the contacts should be connected.

You're going to want to find a way to monitor the engine, so you know when it's running and can stop cranking the starter. You'll likely want to crank the starter in shortish intervals, rather than simply cranking until the engine starts.  You'll want a way to stop cranking the starter after x number of tries, so you don't keep cranking an engine that won't start. You'll also need a lockout mechanism, so that the device cannot start the generator when somebody is working on it or the system. 

As for connecting to the homes electrical system. You're going to want to use properly installed transfer equipment. And you're going to want to make sure the installation is code compliant.

Finally... If you're going to be working on projects like this, you're going to want to learn how to read schematics.  It makes me slightly nervous that you're asking this question.