Gauss cannon and railguns are short range so you will want either good engines or a large percentage of mass, 30%-50%, dedicated to engines in order to have sufficient speed to close with the enemy. You will also want heavy armour, 10%-20% of total mass, in order to survive to reach engagement range. Shields are more for catching the occasional missile that leaks through your point defense screen, normally I'd only put 5% by mass into shields.
If you are using missiles as your offensive weaponry, you can get away with weaker armour, 5%-10% and less engines, 25%.
For gauss PD you will want to design a beam firecontrol 4x speed, 50% range or 25% range. This keeps the firecontrol size down to 2 or 1, as gauss weaponry has such a short range that you don't need longer range firecontrol.
Pick a size for your gauss cannon and desing and research it. Smaller size gives a bigger chance to miss so I tend to stick to full size cannon. You then need to design a turret with the tracking speed to match that of your firecontrol. If you are using smaller ships stick to single or twin turrets as a quad fullsize gauss turret is over 3500 tons.
Remember that you will need a resolution 1 active sensor with a decent range, 3 million km+, in order for your turrets to target incoming missiles.
For railguns as they cannot be turreted you will usually not need to make an increased speed firecontrol unless the ship speed is significantly above the tracking speed level you have researched. You may want to use increased range in order to have a higher hit chance at the end of the railguns range.
Remember that railguns need power, so put powerplants that produce sufficient power to match the capacitors of the railguns on the ship.
Missile design has been covered multiple times in the thread, but here are some basics.
Use size 3-6 missiles for anti ship roles, any larger and you are usually unable to fire them off in large enough salvos to get past enemy point defense.
Use size 1 warhead 1 missiles for anti missile roles, you will want to be able to fit as many as possible onto your ship as you will usually chew through them fast and it will frequently take multiple missiles to score a hit.
You want your warheads to be square numbers, ie 1,4,9,16,25,etc. This is due to the way that damage is applied to armour from missile strikes.
Don't go overboard on fuel. Most of the time there is no need to have excessively long ranges on missiles.
If S = the missile size,
and M = your current missile agility per MSP (depends on tech),
and T = the total MSP available for Engines plus Agility,
Then E = (T/2)+(5xS/M) is the amount of MSP that should be used for Engines
and A = (T/2)-(5xS/M) is the remaining MSP that should be used for Agility.
You need to ensure that your missile firecontrol range is long enough to keep the targets in sight as your missiles will lose tracking if the target gets out of range.
Combat overview, F8
This is where you assign weapons, ECCM and missiles to their firecontrols. You also set firecontrols to a point defense mode here, final defensive fire is the mode you will usually want to use for gauss cannon PD.
You can switch on active sensors and shields from here. Remember shields take 300 seconds to reach full strength and any enemy has to be detected by an active sensor not just passive in order to be targeted.
Once you have available targets you can assign individual firecontrols to each. The buttons under copy targets can speed up assigning multiple ships to the same targets. There are two buttons for open fire, the top only fires the selected firecontol for that ship the lower fires all weapons linked to assigned firecontrols with a target within the fleet.